diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-05-05 06:37:55 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-05-05 06:37:55 +0000 |
| commit | cb2c99d9f87bdb2a4ea5a3486a2844928fa675fb (patch) | |
| tree | 712f7d13a3c9e5c3db0c19e60ff7bcdd329719bd | |
| parent | aaf1521454dda46494cbae57cb919ba4ef476cee (diff) | |
automatic import of python-blockapiopeneuler20.03
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-blockapi.spec | 537 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 539 insertions, 0 deletions
@@ -0,0 +1 @@ +/blockapi-0.20.0.tar.gz diff --git a/python-blockapi.spec b/python-blockapi.spec new file mode 100644 index 0000000..3b28c50 --- /dev/null +++ b/python-blockapi.spec @@ -0,0 +1,537 @@ +%global _empty_manifest_terminate_build 0 +Name: python-blockapi +Version: 0.20.0 +Release: 1 +Summary: BlockAPI library +License: MIT +URL: https://pypi.org/project/blockapi/ +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/06/72/1c85f90974b172f323c2ed5ddd60c26f103f8382b2535dabe07403233bf2/blockapi-0.20.0.tar.gz +BuildArch: noarch + +Requires: python3-requests +Requires: python3-pytz +Requires: python3-dateutil +Requires: python3-coinaddrng +Requires: python3-cfscrape +Requires: python3-ethereum-input-decoder +Requires: python3-web3 +Requires: python3-bs4 +Requires: python3-lxml +Requires: python3-pytest +Requires: python3-pytest-vcr +Requires: python3-requests-mock +Requires: python3-pydantic +Requires: python3-marko +Requires: python3-fake-useragent + +%description +# blockapi + +Library to interact with numerous cryptocurrency data APIs to get the basic info about account balance, transactions, staking informations, etc. +List of supported coins: + +| coin | API name | supported operations +| :---- | :------------| :--------------------- +| XTZ | TzscanAPI | balance, transactions, activations, originations, delegations, endorsements, bakings +| | TzStatsAPI | staking (balance, rewards) +| ATOM | CosmosAPI | balance, transactions, rewards, delegates, votes +| DCR | DcrdataAPI | balance, transactions +| ADA | CardanoExplorerAPI | balance, transactions +| ZEC | ChainSoAPI | balance, transactions +| | MercerweissAPI | balance +| | ZchainAPI | balance +| ETC | BlockscoutAPI | balance +| NEO | NeoscanAPI | balance, transactions +| ZEN | ZensystemAPI | balance +| DASH | ChainSoAPI | balance, transactions +| | CryptoIDAPI | balance +| DOGE | ChainSoAPI |balance, transactions +| BNB | BinanceAPI |balance,transactions +| EOS | EosparkAPI |balance, transactions +| | GreymassAPI | balance +| BCH | BtcAPI | balance +| XLM | StellarAPI | balance +| RVN | RavencoinAPI | balance +| TRX | TronscanAPI | balance +| LTC | BlockcypherAPI | balance +| | ChainSoAPI | balance, transactions +| | CryptoIDAPI | balance +| | Ltc1TrezorAPI | balance, transactions +| BTC | BlockchainInfoAPI | balance, transactions +| | BlockonomicsAPI | balance, transactions +| | ChainSoAPI | balance, transactions +| | Btc1TrezorAPI | balance, transactions +| | Btc2TrezorAPI | balance, transactions +| | BitpayAPI | balance +| GRS | CryptoIDAPI | balance +| ETH | AlethioAPI | balance, transactions, events +| | EtherscanAPI | balance, transactions +| | EthplorerAPI | balance +| ONT | OntioAPI | balance, transactions +| VET | DigonchainAPI | balance +| BOS | BlockchainosAPI | balance, transactions +| LUNA | TerraMoneyAPI | balance, transactions, delegations +| DOT | SubscanPolkaAPI | balance, transactions, staking (locked, rewards) +| KSM | SubscanKusamaAPI | balance, transactions, staking (locked, rewards) + +## Getting Started + +These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. + +### Prerequisites + +Python 3.x, PIP (if you'd like to install it this way). + +### Installing + +Library can be installed simply with pip: + +``` +pip install blockapi +``` + +or by running: +``` +make install +``` + +### Usage examples + +Example usage to get account balance: +``` +import blockapi +myobj = blockapi.api.BlockchainInfoAPI("bitcoin-address-here") +myobj.get_balance() +``` + +For some coins there are multiple APIs available. With get_random_api_class_for_coin it is possible +to randomly pick any of the available APIs: +``` +myapi = blockapi.get_random_api_class_for_coin('BTC')('1F1tAaz5x1HUXrCNLbtMDqcw6o5GNn4xqX') +myapi.get_balance() +``` + +To directly pick first random working API and ask it for the account balance: +``` +>>> blockapi.get_balance_from_random_api('BTC','16ftSEQ4ctQFDtVZiUBusQUjRrGhM3JYwe') +0.010034040000000001 +``` + +It is possible to ask for a list of working APIs for a coin. They are automatically checked first if they work (test is done with asking for a balance). Only APIs which pass this check are returned: +``` +>>> blockapi.get_working_apis_for_coin('BTC') +(<class 'blockapi.api.blockchaininfo.BlockchainInfoAPI'>, <class 'blockapi.api.blockonomics.BlockonomicsAPI'>, <class 'blockapi.api.insight.BitpayAPI'>, <class 'blockapi.api.trezor.Btc2TrezorAPI'>, <class 'blockapi.api.trezor.Btc1TrezorAPI'>) +``` + +During the API instance creation the supplied address is being checked for validity, if the address +is not valid, ValueError exception is being raised: +``` +>>> import blockapi +>>> blockapi.api.CosmosAPI('blahblah') +Traceback (most recent call last): +File "<stdin>", line 1, in <module> +File "/srv/apps/blockapi/src/blockapi/blockapi/services.py", line 195, in __init__ +self.check_validity() +File "/srv/apps/blockapi/src/blockapi/blockapi/services.py", line 201, in check_validity +self.symbol, self.address_info.address +ValueError: Not a valid ATOM address: b'blahblah' +``` + +It is possible to display the result of the address validation with included details like validity, network type, address type, or the info whether the supplied address is an extended one. +Not for all coins all the details are available though: +``` +>>> import blockapi +>>> myapi = blockapi.api.TzscanAPI('valid tezos address here') +>>> myapi.address_info +ValidationResult(name='tezos', ticker='xtz', address=b'valid tezos-address here', valid=True, network='both', is_extended=False, address_type='originated_account') +``` + +## Running the tests + +To run the included tests simply issue: + +``` +make test +``` + +## Contributing + +TBD + +## Authors + +* **Devmons s.r.o. - *Initial work* - [crypkit](https://github.com/crypkit) + +See also the list of [contributors](https://github.com/crypkit/blockapi/contributors) who participated in this project. + +## Credits + +* **Chris Priest - *moneywagon library we took many ideas from* - [moneywagon](https://github.com/priestc/moneywagon) +* **Joe Black - *Address validation library* - [coinaddr](https://github.com/joeblackwaslike/coinaddr) + +## License + +This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details + + + + + +%package -n python3-blockapi +Summary: BlockAPI library +Provides: python-blockapi +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-blockapi +# blockapi + +Library to interact with numerous cryptocurrency data APIs to get the basic info about account balance, transactions, staking informations, etc. +List of supported coins: + +| coin | API name | supported operations +| :---- | :------------| :--------------------- +| XTZ | TzscanAPI | balance, transactions, activations, originations, delegations, endorsements, bakings +| | TzStatsAPI | staking (balance, rewards) +| ATOM | CosmosAPI | balance, transactions, rewards, delegates, votes +| DCR | DcrdataAPI | balance, transactions +| ADA | CardanoExplorerAPI | balance, transactions +| ZEC | ChainSoAPI | balance, transactions +| | MercerweissAPI | balance +| | ZchainAPI | balance +| ETC | BlockscoutAPI | balance +| NEO | NeoscanAPI | balance, transactions +| ZEN | ZensystemAPI | balance +| DASH | ChainSoAPI | balance, transactions +| | CryptoIDAPI | balance +| DOGE | ChainSoAPI |balance, transactions +| BNB | BinanceAPI |balance,transactions +| EOS | EosparkAPI |balance, transactions +| | GreymassAPI | balance +| BCH | BtcAPI | balance +| XLM | StellarAPI | balance +| RVN | RavencoinAPI | balance +| TRX | TronscanAPI | balance +| LTC | BlockcypherAPI | balance +| | ChainSoAPI | balance, transactions +| | CryptoIDAPI | balance +| | Ltc1TrezorAPI | balance, transactions +| BTC | BlockchainInfoAPI | balance, transactions +| | BlockonomicsAPI | balance, transactions +| | ChainSoAPI | balance, transactions +| | Btc1TrezorAPI | balance, transactions +| | Btc2TrezorAPI | balance, transactions +| | BitpayAPI | balance +| GRS | CryptoIDAPI | balance +| ETH | AlethioAPI | balance, transactions, events +| | EtherscanAPI | balance, transactions +| | EthplorerAPI | balance +| ONT | OntioAPI | balance, transactions +| VET | DigonchainAPI | balance +| BOS | BlockchainosAPI | balance, transactions +| LUNA | TerraMoneyAPI | balance, transactions, delegations +| DOT | SubscanPolkaAPI | balance, transactions, staking (locked, rewards) +| KSM | SubscanKusamaAPI | balance, transactions, staking (locked, rewards) + +## Getting Started + +These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. + +### Prerequisites + +Python 3.x, PIP (if you'd like to install it this way). + +### Installing + +Library can be installed simply with pip: + +``` +pip install blockapi +``` + +or by running: +``` +make install +``` + +### Usage examples + +Example usage to get account balance: +``` +import blockapi +myobj = blockapi.api.BlockchainInfoAPI("bitcoin-address-here") +myobj.get_balance() +``` + +For some coins there are multiple APIs available. With get_random_api_class_for_coin it is possible +to randomly pick any of the available APIs: +``` +myapi = blockapi.get_random_api_class_for_coin('BTC')('1F1tAaz5x1HUXrCNLbtMDqcw6o5GNn4xqX') +myapi.get_balance() +``` + +To directly pick first random working API and ask it for the account balance: +``` +>>> blockapi.get_balance_from_random_api('BTC','16ftSEQ4ctQFDtVZiUBusQUjRrGhM3JYwe') +0.010034040000000001 +``` + +It is possible to ask for a list of working APIs for a coin. They are automatically checked first if they work (test is done with asking for a balance). Only APIs which pass this check are returned: +``` +>>> blockapi.get_working_apis_for_coin('BTC') +(<class 'blockapi.api.blockchaininfo.BlockchainInfoAPI'>, <class 'blockapi.api.blockonomics.BlockonomicsAPI'>, <class 'blockapi.api.insight.BitpayAPI'>, <class 'blockapi.api.trezor.Btc2TrezorAPI'>, <class 'blockapi.api.trezor.Btc1TrezorAPI'>) +``` + +During the API instance creation the supplied address is being checked for validity, if the address +is not valid, ValueError exception is being raised: +``` +>>> import blockapi +>>> blockapi.api.CosmosAPI('blahblah') +Traceback (most recent call last): +File "<stdin>", line 1, in <module> +File "/srv/apps/blockapi/src/blockapi/blockapi/services.py", line 195, in __init__ +self.check_validity() +File "/srv/apps/blockapi/src/blockapi/blockapi/services.py", line 201, in check_validity +self.symbol, self.address_info.address +ValueError: Not a valid ATOM address: b'blahblah' +``` + +It is possible to display the result of the address validation with included details like validity, network type, address type, or the info whether the supplied address is an extended one. +Not for all coins all the details are available though: +``` +>>> import blockapi +>>> myapi = blockapi.api.TzscanAPI('valid tezos address here') +>>> myapi.address_info +ValidationResult(name='tezos', ticker='xtz', address=b'valid tezos-address here', valid=True, network='both', is_extended=False, address_type='originated_account') +``` + +## Running the tests + +To run the included tests simply issue: + +``` +make test +``` + +## Contributing + +TBD + +## Authors + +* **Devmons s.r.o. - *Initial work* - [crypkit](https://github.com/crypkit) + +See also the list of [contributors](https://github.com/crypkit/blockapi/contributors) who participated in this project. + +## Credits + +* **Chris Priest - *moneywagon library we took many ideas from* - [moneywagon](https://github.com/priestc/moneywagon) +* **Joe Black - *Address validation library* - [coinaddr](https://github.com/joeblackwaslike/coinaddr) + +## License + +This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details + + + + + +%package help +Summary: Development documents and examples for blockapi +Provides: python3-blockapi-doc +%description help +# blockapi + +Library to interact with numerous cryptocurrency data APIs to get the basic info about account balance, transactions, staking informations, etc. +List of supported coins: + +| coin | API name | supported operations +| :---- | :------------| :--------------------- +| XTZ | TzscanAPI | balance, transactions, activations, originations, delegations, endorsements, bakings +| | TzStatsAPI | staking (balance, rewards) +| ATOM | CosmosAPI | balance, transactions, rewards, delegates, votes +| DCR | DcrdataAPI | balance, transactions +| ADA | CardanoExplorerAPI | balance, transactions +| ZEC | ChainSoAPI | balance, transactions +| | MercerweissAPI | balance +| | ZchainAPI | balance +| ETC | BlockscoutAPI | balance +| NEO | NeoscanAPI | balance, transactions +| ZEN | ZensystemAPI | balance +| DASH | ChainSoAPI | balance, transactions +| | CryptoIDAPI | balance +| DOGE | ChainSoAPI |balance, transactions +| BNB | BinanceAPI |balance,transactions +| EOS | EosparkAPI |balance, transactions +| | GreymassAPI | balance +| BCH | BtcAPI | balance +| XLM | StellarAPI | balance +| RVN | RavencoinAPI | balance +| TRX | TronscanAPI | balance +| LTC | BlockcypherAPI | balance +| | ChainSoAPI | balance, transactions +| | CryptoIDAPI | balance +| | Ltc1TrezorAPI | balance, transactions +| BTC | BlockchainInfoAPI | balance, transactions +| | BlockonomicsAPI | balance, transactions +| | ChainSoAPI | balance, transactions +| | Btc1TrezorAPI | balance, transactions +| | Btc2TrezorAPI | balance, transactions +| | BitpayAPI | balance +| GRS | CryptoIDAPI | balance +| ETH | AlethioAPI | balance, transactions, events +| | EtherscanAPI | balance, transactions +| | EthplorerAPI | balance +| ONT | OntioAPI | balance, transactions +| VET | DigonchainAPI | balance +| BOS | BlockchainosAPI | balance, transactions +| LUNA | TerraMoneyAPI | balance, transactions, delegations +| DOT | SubscanPolkaAPI | balance, transactions, staking (locked, rewards) +| KSM | SubscanKusamaAPI | balance, transactions, staking (locked, rewards) + +## Getting Started + +These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. + +### Prerequisites + +Python 3.x, PIP (if you'd like to install it this way). + +### Installing + +Library can be installed simply with pip: + +``` +pip install blockapi +``` + +or by running: +``` +make install +``` + +### Usage examples + +Example usage to get account balance: +``` +import blockapi +myobj = blockapi.api.BlockchainInfoAPI("bitcoin-address-here") +myobj.get_balance() +``` + +For some coins there are multiple APIs available. With get_random_api_class_for_coin it is possible +to randomly pick any of the available APIs: +``` +myapi = blockapi.get_random_api_class_for_coin('BTC')('1F1tAaz5x1HUXrCNLbtMDqcw6o5GNn4xqX') +myapi.get_balance() +``` + +To directly pick first random working API and ask it for the account balance: +``` +>>> blockapi.get_balance_from_random_api('BTC','16ftSEQ4ctQFDtVZiUBusQUjRrGhM3JYwe') +0.010034040000000001 +``` + +It is possible to ask for a list of working APIs for a coin. They are automatically checked first if they work (test is done with asking for a balance). Only APIs which pass this check are returned: +``` +>>> blockapi.get_working_apis_for_coin('BTC') +(<class 'blockapi.api.blockchaininfo.BlockchainInfoAPI'>, <class 'blockapi.api.blockonomics.BlockonomicsAPI'>, <class 'blockapi.api.insight.BitpayAPI'>, <class 'blockapi.api.trezor.Btc2TrezorAPI'>, <class 'blockapi.api.trezor.Btc1TrezorAPI'>) +``` + +During the API instance creation the supplied address is being checked for validity, if the address +is not valid, ValueError exception is being raised: +``` +>>> import blockapi +>>> blockapi.api.CosmosAPI('blahblah') +Traceback (most recent call last): +File "<stdin>", line 1, in <module> +File "/srv/apps/blockapi/src/blockapi/blockapi/services.py", line 195, in __init__ +self.check_validity() +File "/srv/apps/blockapi/src/blockapi/blockapi/services.py", line 201, in check_validity +self.symbol, self.address_info.address +ValueError: Not a valid ATOM address: b'blahblah' +``` + +It is possible to display the result of the address validation with included details like validity, network type, address type, or the info whether the supplied address is an extended one. +Not for all coins all the details are available though: +``` +>>> import blockapi +>>> myapi = blockapi.api.TzscanAPI('valid tezos address here') +>>> myapi.address_info +ValidationResult(name='tezos', ticker='xtz', address=b'valid tezos-address here', valid=True, network='both', is_extended=False, address_type='originated_account') +``` + +## Running the tests + +To run the included tests simply issue: + +``` +make test +``` + +## Contributing + +TBD + +## Authors + +* **Devmons s.r.o. - *Initial work* - [crypkit](https://github.com/crypkit) + +See also the list of [contributors](https://github.com/crypkit/blockapi/contributors) who participated in this project. + +## Credits + +* **Chris Priest - *moneywagon library we took many ideas from* - [moneywagon](https://github.com/priestc/moneywagon) +* **Joe Black - *Address validation library* - [coinaddr](https://github.com/joeblackwaslike/coinaddr) + +## License + +This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details + + + + + +%prep +%autosetup -n blockapi-0.20.0 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-blockapi -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Fri May 05 2023 Python_Bot <Python_Bot@openeuler.org> - 0.20.0-1 +- Package Spec generated @@ -0,0 +1 @@ +1118c1a031ae646cda12e03598e5a504 blockapi-0.20.0.tar.gz |
