{"id":21528507,"url":"https://github.com/fibercrypto/pyskyfiber","last_synced_at":"2025-09-19T17:57:19.627Z","repository":{"id":62583535,"uuid":"218875228","full_name":"fibercrypto/pyskyfiber","owner":"fibercrypto","description":"Skycoin Python client library","archived":false,"fork":false,"pushed_at":"2020-03-13T03:08:25.000Z","size":3838,"stargazers_count":1,"open_issues_count":17,"forks_count":1,"subscribers_count":5,"default_branch":"develop","last_synced_at":"2025-02-25T05:34:54.506Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fibercrypto.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-31T23:01:11.000Z","updated_at":"2020-11-02T19:14:38.000Z","dependencies_parsed_at":"2022-11-03T21:49:31.820Z","dependency_job_id":null,"html_url":"https://github.com/fibercrypto/pyskyfiber","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibercrypto%2Fpyskyfiber","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibercrypto%2Fpyskyfiber/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibercrypto%2Fpyskyfiber/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibercrypto%2Fpyskyfiber/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fibercrypto","download_url":"https://codeload.github.com/fibercrypto/pyskyfiber/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244092019,"owners_count":20396719,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T01:53:30.149Z","updated_at":"2025-09-19T17:57:14.580Z","avatar_url":"https://github.com/fibercrypto.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PySkyfiber\n\n[![Build Status](https://travis-ci.com/fibercrypto/pyskyfiber.svg?branch=develop)](https://travis-ci.com/fibercrypto/pyskyfiber)\n\nPython extension for Skycoin API.\nA Python extension generated with SWIG to access Skycoin API from Python.\n\n## Table of Contents\n\n\u003c!-- MarkdownTOC levels=\"1,2,3,4,5\" autolink=\"true\" bracket=\"round\" --\u003e\n- [Installation](#installation)\n- [Using the API](#usage)\n  - [Naming](#naming)\n  - [Parameters](#parameters)\n    - [Handles](#handles)\n    - [Byte Slices](#byte-slices)\n    - [Structures](#structures)\n    - [Fixed Size Arrays](#fixed-size-array)\n    - [Other Slices](#other-slices)\n    - [Memory Managemanet](#memory-management)\n- [Make rules](#make-rules)\n- [Development setup](#development-setup)\n  - [Running tests](#running-tests)\n  - [Releases](#releases)\n    - [Update the version](#update-the-version)\n    - [Pre-release testing](#pre-release-testing)\n    - [Release signing](#release-signing)\n    - [Alternative signing keys](#alternative-signing-keys)\n    - [Creating release builds](#creating-release-builds)\n    - [Creating release builds to manylinux](#creating-release-builds-to-manylinux)\n- [Python wrapper for Skycoin Api](#python-wrapper-for-skycoin-api)\n\u003c!-- /MarkdownTOC --\u003e\n\n## Installation\n\nDownload the repository from http://github.com/fibercrypto/pyskyfiber.git. \nExecute (`python setup.py install`) to install the library. Although executing (python setup.py develop) is a better choice for making changes to the library. However, when using tox these commands are not required at all because calling tox will make any necessary installation and execute the tests.\n\n## Usage\n### Naming\n\nThe exported function in PySkycoin have the following naming format: `SKY_package_func_name` where package is replace by the package where the original Skycoin function is and func_name is the name of the function. For example, `LoadConfig` function from `cli` package is called in Python `SKY_cli_LoadConfig`\n### Parameters\n\nAll skycoin exported functions return an error object as the last of the return parameters. In Pyskycoin error is return as an integer and it is the first return parameter. The rest of the parameters are returned in the same order.\n\nReceivers in Skycoin are the first of the input parameters. Simple types, like integer, float, string will be used as the corresponding types in Python.\n\n#### Handles\n\nSome of Skycoin types are too complex to be exported to a scripting language. So, handles are used instead. Therefore all functions taking a complex type will receive a handle instead of the original Skycoin type. For example, having these functions exported from Skycoin:\n\n```go\n\tfunc LoadConfig() (Config, error)\n\tfunc (c Config) FullWalletPath() string\n```\n\n\nConfig is a struct type that is treated as a handle in Pyskycoin. The usage in Python will be:\n\n```python\n\nimport skycoin\n\t\ndef main:\n\terr, configHandle = skycoin.SKY_cli_LoadConfig()\n\tif err == skycoin.SKY_OK:  # 0 then no error\n\t\tfullWalletPath = skycoin.SKY_cli_FullWalletPath(configHandle)\n\t\tprint fullWallerPath\n\t\t#Close the handle after using the it\n\t\t#so the garbage collector can delete the object associated with it. \n\t\tskycoin.SKY_handle_close( configHandle )\n\telse: \n\t\t#Error\n\t\tprint err\n```\n\n#### Byte slices\n\nParameters of type byte[] will treated as string . Example, this function in Skycoin:\n\n```go\nfunc (s ScryptChacha20poly1305) Encrypt(data, password []byte) ([]byte, error)\n```\n\nWill be called like this:\n\n```python\nencrypt_settings = skycoin.encrypt__ScryptChacha20poly1305()\ndata = b\"Data to encrypt\" #It will be passed as a parameter of type []byte\npwd = b\"password\"         #As []byte too\nerr, encrypted = skycoin.SKY_encrypt_ScryptChacha20poly1305_Encrypt(encrypt_settings, data, pwd)\nif err == skycoin.SKY_OK:\n\tprint encrypted #Encrypted is string\n```\n\n#### Structures\n\nStructures that are not exported as handles are treated like classes in Python. In the previous example type ScryptChacha20poly1305 is created in Python like:\n\n```python\nencrypt_settings = skycoin.encrypt__ScryptChacha20poly1305()\n```\n\nAnd passed as first parameter in call to SKY_encrypt_ScryptChacha20poly1305_Encrypt.\n\n#### Fixed Sized Arrays\n\nParameters of fixed size array are wrapped in structures when called from python.\n\nGiven these types in Skycoin:\n\n```go\n\ttype PubKey [33]byte\n\ttype SecKey [32]byte\n```\n\nAnd this exported function:\n\n```go\n\tfunc GenerateDeterministicKeyPair(seed []byte) (PubKey, SecKey)\n```\n\t\nThis is how it is used in Python:\n\n```python\n#Generates random seed\nerr, data = skycoin.SKY_cipher_RandByte(32)\nassert err == skycoin.SKY_OK\npubkey = skycoin.cipher_PubKey()\nseckey = skycoin.cipher_SecKey()\nerr = skycoin.SKY_cipher_GenerateDeterministicKeyPair(data, pubkey, seckey)\n```\n\npubkey and seckey are objects of type structure containing a field name data for the corresponding type of PubKey and SecKey. Something like:\n\n```cpp\n\tcipher_PubKey struct{\n\t\tdata [33]byte;\n\t} cipher_PubKey;\n\n\tcipher_SecKey struct{\n\t\tdata [32]byte;\n\t} ;\n```\n\n#### Other Slices\n\nOther slices of type different than byte were wrapped inside classes. Calling the following function:\n\n```go\nfunc GenerateDeterministicKeyPairs(seed []byte, n int) []SecKey\n```\n\t\nWould be like:\n\n```python\n#Generates random seed\nerr, seed = skycoin.SKY_cipher_RandByte(32)\nerr, seckeys = skycoin.SKY_cipher_GenerateDeterministicKeyPairs(seed, 2)\nfor seckey in seckeys:\n\tpubkey = skycoin.cipher_PubKey()\n\tskycoin.SKY_cipher_PubKeyFromSecKey(seckey, pubkey)\n\terr = skycoin.SKY_cipher_PubKey_Verify(pubkey)\n\tassert err == skycoin.SKY_OK\n```\n\n## Example of how to verify address\n\n```python\ndef addressIsValid(addr):\n    addres = skycoin.cipher__Address()\n    err = skycoin.SKY_cipher_DecodeBase58Address(addr, addres)\n    return err != skycoin.SKY_OK\n```\n\n\n### Memory Management\n\nMemory management is transparent to the user. Any object allocated inside the library is left to be managed by Python garbage collector.\n\n## Make Rules\n\nAll these make rules require skycoin to be a git submodule of pyskycoin\n\n- build-libc\n  * Compiles skycoin C language library.\n- build-swig\n  * Creates the wrapper C code to generate the Python library.\n- develop\n  * Install a developer version of the module.\t\n- test\n  * Compiles skycoin C language library, creates the wrapper and execute Tox. Tox installs compiles the Python library and executes the tests.\t\n\n## Development setup\n\nIt is highly recommended for developers to setup their environment using\nthe available Docker images.\nRead the [PySkycoin Docker docs](docker/images/dev-cli/README.md) for further\ndetails.\n\nThe project has two branches: `master` and `develop`.\n\n- `develop` is the default branch and will always have the latest code.\n  The submodule at `gopath/src/github.com/fibercrypto/libskyfiber` has to be\n  in sync with `SkycoinProject/skycoin` `develop` branch.\n- `master` will always be equal to the current stable release on the website, and should correspond with the latest release tag.\n  The submodule at `gopath/src/github.com/fibercrypto/libskyfiber` has to be\n  in sync with `SkycoinProject/skycoin` `master` branch.\n\nSeparate stable development branches will be created to work on releases for supporting the\nmost recent stable version of Skycoin. The name of these branches should be the Skycoin\nmajor and minor version numbers followed by `dev` suffix e.g. `0.25dev`.\nThese branches may be forked out of either `master` or `develop` branches, and \nthe submodule at `gopath/src/github.com/fibercrypto/libskyfiber` has to be\nin sync with the corresponding tag of `fibercrypto/libskyfiber` official repository.\n\nStable development branches are created most of the time for the following reasons:\n\n- A Skycoin release increasing [patch version number](https://semver.org/).\n- Enhanced support and bug fixes for a version of PySkycoin compiled against an\n  stable version of Skycoin\n- Backporting useful features added in `develop`.\n\n### Running tests\n\n```sh\n$ make test\n```\n\n### Releases\n\n#### Update the version\n\n0. If the `master` branch has commits that are not in `develop` (e.g. due to a hotfix applied to `master`), merge `master` into `develop` (and fix any build or test failures)\n0. Switch to a new release branch named `release-X.Y.Z` for preparing the release.\n0. Ensure that the submodule at `gopath/src/github.com/fibercrypto/libskyfiber` is in sync with respect to the corresponding tag in https://github.com/fibercrypto/libskyfiber repository.\n0. Update `__version__` in `skycoin/__init__.py`\n0. Run `make build` to make sure that the code base is up to date\n0. Update `CHANGELOG.md`: move the \"unreleased\" changes to the version and add the date.\n0. Follow the steps in [pre-release testing](#pre-release-testing)\n0. Make a PR merging the release branch into `master`\n0. Review the PR and merge it\n0. Update files in https://github.com/SkycoinProject/repo-info/tree/master/repos/skycoin/remote for `simelotech/skycoindev-dotnet` Docker image, adding a new file for the new version and adjusting any configuration text that may have changed\n0. Tag the `master` branch with the version number. Version tags start with `v`, e.g. `v0.20.0`. Sign the tag. If you have your GPG key in github, creating a release on the Github website will automatically tag the release. It can be tagged from the command line with `git tag -as v0.20.0 $COMMIT_ID`, but Github will not recognize it as a \"release\".\n0. Release builds are created and uploaded by travis. To do it manually, checkout the master branch and follow the [create release builds instructions](#creating-release-builds).\n0. Checkout `develop` branch and bump `__version__` to next [`dev` version number](https://www.python.org/dev/peps/pep-0440/#developmental-releases).\n\n#### Pre-release testing\n\nPerform these actions before releasing:\n\n```sh\nmake test-ci\n```\n\n#### Release signing\n\nReleases are signed with this PGP key:\n\n`0x5801631BD27C7874`\n\nThe fingerprint for this key is:\n\n```\npub   ed25519 2017-09-01 [SC] [expires: 2023-03-18]\n      10A7 22B7 6F2F FE7B D238  0222 5801 631B D27C 7874\nuid                      GZ-C SKYCOIN \u003ctoken@protonmail.com\u003e\nsub   cv25519 2017-09-01 [E] [expires: 2023-03-18]\n```\n\nKeybase.io account: https://keybase.io/gzc \n\n##### Alternative signing keys:\n\nKeybase.io account: https://keybase.io/olemis\n\nThe fingerprint for this key is:\n\n```\npub   rsa4096 2019-01-17 [SC] [expires: 2024-01-16]\nuid           Olemis Lang \u003colemis@simelo.tech\u003e\nsub   rsa4096 2019-01-17 [E] [expires: 2024-01-16]\n```\n\nFollow the [Tor Project's instructions for verifying signatures](https://www.torproject.org/docs/verifying-signatures.html.en).\n\nReleases and their signatures can be found on the [releases page](https://github.com/fibercrypto/pyskycoin/releases).\n\nInstructions for generating a PGP key, publishing it, signing the tags and binaries:\nhttps://gist.github.com/gz-c/de3f9c43343b2f1a27c640fe529b067c\n\n#### Creating release builds\n\nRelease builds should be created from git tags . After [updating release version](#update-the-version) it is necessary to follow these steps\n\n```sh\ncd /path/to/pyskycoin\npython3 setup.py sdist bdist_wheel\npython3 -m pip install --user --upgrade twine\ntwine upload --repository-url https://test.pypi.org/legacy/ dist/*\n```\n\nThis is automatically done for `travis-ci` and `circle-ci`.\n\n#### Creating release builds to manylinux\n\nRelease builds should be created from git tags . After [updating release version](#update-the-version) it is necessary to follow these steps\n\nFor `64bits` builds:\n\n```sh\ncd /path/to/pyskycoin\nmake bdist_manylinux\npython3 -m pip install --user --upgrade twine\ntwine upload --repository-url https://test.pypi.org/legacy/ dist/*\n```\n\nIn case `32bits` builds:\n\n```sh\ncd /path/to/pyskycoin\nmake bdist_manylinux_i686\npython3 -m pip install --user --upgrade twine\ntwine upload --repository-url https://test.pypi.org/legacy/ dist/*\n```\n\nThis is the same process that `skyapi` follows.\n\nThis is done automatically in `travis-ci` and` circle-ci`, and even if there is an option to do it manually, this process should be automatic.\n\n## Python wrapper for Skycoin Api\n\nThis wrapper is Auto generated by openapi-generator directly from `Skycoin Api` code for version v0.25.1.\n\nFor further details of usage of `Python wrapper for Skycoin Api` see [Autogenerated documentation](./skyapi/README.md)\n\nTo use wrapper for specific node of Skycoin api, just do the next:\n\n```python\n\n# create an instance of the Configuration class\nconfiguration = skyapi.Configuration()\n# set new host\nconfiguration.host = 'some_host'\n\n# create an instance of the API class with new configuration\napi_instance = skyapi.DefaultApi(skyapi.ApiClient(configuration))\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffibercrypto%2Fpyskyfiber","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffibercrypto%2Fpyskyfiber","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffibercrypto%2Fpyskyfiber/lists"}