# **SimpleSwap.io API Python Package**
## How to install?
```shell
pip install simpleswap
```
---
## Usage:
```python
from simpleswap import SimpleSwap
simpleswap = SimpleSwap("YOUR-API-KEY")
#...
```
- Get Your API Key from [partners.simpleswap.io](https://partners.simpleswap.io/)
### Currency API:
##### Get Currency Info:
```python
currency = simpleswap.currency.get_currency("btc")
print(currency.name) # Bitcoin
```
##### Get All Currencies Available:
```python
currencies = simpleswap.currency.get_all_currencies()
for currency in currencies:
print(currency.name) # Bitcoin, Ethereum, etc
```
---
### Exchange API:
##### Create Exchange:
```python
exchange = simpleswap.exchange.create_exchange(
"btc",
"eth",
0.1,
"0xBF651C3EC24c099C182410a0F9BF13ac9facFF92")
print(exchange.id) # abdef1234
```
##### Get Exchange by ID:
```python
exchange = simpleswap.exchange.get_exchange("abdef1234")
print(exchange.id) # abdef1234
```
##### Get Exchanges:
```python
after_date = datetime(2024, 9, 18, 0, 0, 0)
# or
before_date = datetime(2024, 9, 19, 0, 0, 0)
exchanges = simpleswap.exchange.get_exchanges(
limit=50,
offset=3,
after_date=after_date,
before_date=before_date)
for exchange in exchanges:
print(exchange.id) # abdef1234
```
##### Check Exchange:
```python
is_valid = simpleswap.exchange.check_exchange(
"btc",
"eth",
0.1)
print(is_valid) # True
```
##### Get Estimated Exchanged Value:
```python
value = simpleswap.exchange.get_estimated(
"btc",
"eth",
0.1)
print(value) # 2.52735024
```
##### Get Exchange Ranges for Currency:
```python
ranges = simpleswap.exchange.get_ranges(
"btc",
"eth")
print(ranges.min) # 0.001
```
---
### Market API:
##### Get Market Info:
```python
market_rates = simpleswap.market.get_market_info()
for market_rate in market_rates:
print(market_rate.min) # 0.001
print(market_rate.max) # 100
print(market_rate.rate) # 100000.5
```
---
### Pairs API:
##### Get Currency Pairs:
```python
pairs = simpleswap.pairs.get_pairs("btc")
for pair in pairs:
print(pair) # eth
```
##### Get All Currencies Pairs:
```python
pairs = simpleswap.pairs.get_all_pairs()
for item in pairs.btc:
print(item) # eth, etc
```
---
Don't forget to view API docs on [simpleswap.io](https://api.simpleswap.io/#/)
Keep in touch with me [@codingtelegrambots](https://t.me/codingtelegrambots)
Be first to join my channel for incomming updates [@drkhedr_projects](https://t.me/drkhedr_projects)
Visit my websites:
- [drkhedr.com](https://drkhedr.com)
- [codingtelegrambots.com](https://codingtelegrambots.com)
Raw data
{
"_id": null,
"home_page": null,
"name": "simpleswap",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "python, simpleswap, api, cryptocurrency, exchange, crypto api, simpleswap api, cryptocurrency exchange api",
"author": "drkhedr (Abdelrahman Khedr)",
"author_email": "<dev@drkhedr.com>",
"download_url": "https://files.pythonhosted.org/packages/1b/55/41a25340e2c269a9abe3ac1d21082852e567e43172d4a002cd531d355556/simpleswap-1.0.0.tar.gz",
"platform": null,
"description": "\r\n# **SimpleSwap.io API Python Package**\r\n\r\n\r\n\r\n## How to install?\r\n\r\n\r\n\r\n```shell\r\n\r\npip install simpleswap\r\n\r\n```\r\n\r\n\r\n\r\n---\r\n\r\n\r\n\r\n## Usage:\r\n\r\n\r\n\r\n```python\r\n\r\nfrom simpleswap import SimpleSwap\r\n\r\n\r\n\r\nsimpleswap = SimpleSwap(\"YOUR-API-KEY\")\r\n\r\n\r\n\r\n#...\r\n\r\n```\r\n\r\n\r\n\r\n- Get Your API Key from [partners.simpleswap.io](https://partners.simpleswap.io/)\r\n\r\n\r\n\r\n### Currency API:\r\n\r\n\r\n\r\n##### Get Currency Info:\r\n\r\n\r\n\r\n```python\r\n\r\ncurrency = simpleswap.currency.get_currency(\"btc\")\r\n\r\n\r\n\r\nprint(currency.name) # Bitcoin\r\n\r\n\r\n\r\n```\r\n\r\n\r\n\r\n##### Get All Currencies Available:\r\n\r\n\r\n\r\n```python\r\n\r\ncurrencies = simpleswap.currency.get_all_currencies()\r\n\r\n\r\n\r\nfor currency in currencies:\r\n\r\n print(currency.name) # Bitcoin, Ethereum, etc\r\n\r\n\r\n\r\n```\r\n\r\n\r\n\r\n---\r\n\r\n\r\n\r\n### Exchange API:\r\n\r\n\r\n\r\n##### Create Exchange:\r\n\r\n\r\n\r\n```python\r\n\r\nexchange = simpleswap.exchange.create_exchange(\r\n\r\n \"btc\",\r\n\r\n \"eth\",\r\n\r\n 0.1,\r\n\r\n \"0xBF651C3EC24c099C182410a0F9BF13ac9facFF92\")\r\n\r\n\r\n\r\nprint(exchange.id) # abdef1234\r\n\r\n\r\n\r\n```\r\n\r\n\r\n\r\n##### Get Exchange by ID:\r\n\r\n\r\n\r\n```python\r\n\r\n\r\n\r\nexchange = simpleswap.exchange.get_exchange(\"abdef1234\")\r\n\r\n\r\n\r\nprint(exchange.id) # abdef1234\r\n\r\n\r\n\r\n```\r\n\r\n\r\n\r\n##### Get Exchanges:\r\n\r\n\r\n\r\n```python\r\n\r\nafter_date = datetime(2024, 9, 18, 0, 0, 0)\r\n\r\n# or\r\n\r\nbefore_date = datetime(2024, 9, 19, 0, 0, 0)\r\n\r\n\r\n\r\nexchanges = simpleswap.exchange.get_exchanges(\r\n\r\n limit=50,\r\n\r\n offset=3,\r\n\r\n after_date=after_date,\r\n\r\n before_date=before_date)\r\n\r\n\r\n\r\nfor exchange in exchanges:\r\n\r\n print(exchange.id) # abdef1234\r\n\r\n\r\n\r\n```\r\n\r\n\r\n\r\n##### Check Exchange:\r\n\r\n\r\n\r\n```python\r\n\r\n\r\n\r\nis_valid = simpleswap.exchange.check_exchange(\r\n\r\n \"btc\",\r\n\r\n \"eth\",\r\n\r\n 0.1)\r\n\r\n\r\n\r\nprint(is_valid) # True\r\n\r\n\r\n\r\n```\r\n\r\n\r\n\r\n##### Get Estimated Exchanged Value:\r\n\r\n\r\n\r\n```python\r\n\r\n\r\n\r\nvalue = simpleswap.exchange.get_estimated(\r\n\r\n \"btc\",\r\n\r\n \"eth\",\r\n\r\n 0.1)\r\n\r\n\r\n\r\nprint(value) # 2.52735024\r\n\r\n\r\n\r\n```\r\n\r\n\r\n\r\n##### Get Exchange Ranges for Currency:\r\n\r\n\r\n\r\n```python\r\n\r\n\r\n\r\nranges = simpleswap.exchange.get_ranges(\r\n\r\n \"btc\",\r\n\r\n \"eth\")\r\n\r\n\r\n\r\nprint(ranges.min) # 0.001\r\n\r\n\r\n\r\n```\r\n\r\n\r\n\r\n---\r\n\r\n\r\n\r\n### Market API:\r\n\r\n\r\n\r\n##### Get Market Info:\r\n\r\n\r\n\r\n```python\r\n\r\n\r\n\r\nmarket_rates = simpleswap.market.get_market_info()\r\n\r\n\r\n\r\nfor market_rate in market_rates:\r\n\r\n print(market_rate.min) # 0.001\r\n\r\n print(market_rate.max) # 100\r\n\r\n print(market_rate.rate) # 100000.5\r\n\r\n\r\n\r\n```\r\n\r\n\r\n\r\n---\r\n\r\n\r\n\r\n### Pairs API:\r\n\r\n\r\n\r\n##### Get Currency Pairs:\r\n\r\n\r\n\r\n```python\r\n\r\n\r\n\r\npairs = simpleswap.pairs.get_pairs(\"btc\")\r\n\r\n\r\n\r\nfor pair in pairs:\r\n\r\n print(pair) # eth\r\n\r\n\r\n\r\n```\r\n\r\n\r\n\r\n##### Get All Currencies Pairs:\r\n\r\n\r\n\r\n```python\r\n\r\n\r\n\r\npairs = simpleswap.pairs.get_all_pairs()\r\n\r\n\r\n\r\nfor item in pairs.btc:\r\n\r\n print(item) # eth, etc\r\n\r\n\r\n\r\n```\r\n\r\n\r\n\r\n---\r\n\r\n\r\n\r\nDon't forget to view API docs on [simpleswap.io](https://api.simpleswap.io/#/)\r\n\r\n\r\n\r\nKeep in touch with me [@codingtelegrambots](https://t.me/codingtelegrambots)\r\n\r\n\r\n\r\nBe first to join my channel for incomming updates [@drkhedr_projects](https://t.me/drkhedr_projects)\r\n\r\n\r\n\r\nVisit my websites:\r\n\r\n\r\n\r\n- [drkhedr.com](https://drkhedr.com)\r\n\r\n- [codingtelegrambots.com](https://codingtelegrambots.com)\r\n\r\n",
"bugtrack_url": null,
"license": null,
"summary": "A package to enable API calls to the simpleswap.io API",
"version": "1.0.0",
"project_urls": null,
"split_keywords": [
"python",
" simpleswap",
" api",
" cryptocurrency",
" exchange",
" crypto api",
" simpleswap api",
" cryptocurrency exchange api"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "806db595c8768b2014fb2a44687e6c12dd706e68c63f49e29ceaed7f5daa0068",
"md5": "51e78e5f4efb168aa31dbad75524e9d5",
"sha256": "6800c0adc26d8c54032f5fed2deeecdb00e3e1bb652c45e06524ad068f667690"
},
"downloads": -1,
"filename": "simpleswap-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "51e78e5f4efb168aa31dbad75524e9d5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 7028,
"upload_time": "2024-09-17T23:55:16",
"upload_time_iso_8601": "2024-09-17T23:55:16.874601Z",
"url": "https://files.pythonhosted.org/packages/80/6d/b595c8768b2014fb2a44687e6c12dd706e68c63f49e29ceaed7f5daa0068/simpleswap-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1b5541a25340e2c269a9abe3ac1d21082852e567e43172d4a002cd531d355556",
"md5": "da4c15c18ba2f80e7c82b65945427c7d",
"sha256": "c527a0eba65912d960fb798ace8cec1e9ec13310d0e8b959f3a49023f940ddf0"
},
"downloads": -1,
"filename": "simpleswap-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "da4c15c18ba2f80e7c82b65945427c7d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 6485,
"upload_time": "2024-09-17T23:55:18",
"upload_time_iso_8601": "2024-09-17T23:55:18.471275Z",
"url": "https://files.pythonhosted.org/packages/1b/55/41a25340e2c269a9abe3ac1d21082852e567e43172d4a002cd531d355556/simpleswap-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-17 23:55:18",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "simpleswap"
}