Skip to main content

Onlinesim Python API

Wrapper for automatic reception of SMS-messages by onlinesim.ru

N|Solid Python publish

Installation

You can install or upgrade package with:

$ pip install onlinesimru --upgrade

Or you can install from source with:

$ git clone https://github.com/s00d/onlinesim-python-api
$ cd onlinesim-python-api
$ python setup.py install

...or install from source buth with pip

$ pip install git+https://github.com/s00d/onlinesim-python-api

Example

from onlinesimru import FreeNumbersService, RentNumbersService, ProxyService, UserService, NumbersService


def main():
    client = UserService('YOUR_TOKEN')
    balance = client.balance()
    print(balance)


main()

Example2

from onlinesimru import FreeNumbersService, RentNumbersService, ProxyService, UserService, NumbersService


def main():
    numbers = NumbersService('YOUR_TOKEN')
    input('Press enter if you sms was sent')

    tzid = numbers.get('service')
    print(tzid)
    code = numbers.wait_code(tzid)
    print(code)


main()

Example3

# multiple driver using
from onlinesimru import Driver


def main():
    driver = Driver('YOUR_TOKEN')

    tzid = driver.numbers().get('service')
    print(tzid)
    code = driver.numbers().wait_code(tzid)
    print(code)


main()

Example4 - Custom Domain

# Using custom domain for API endpoints
from onlinesimru import Driver


def main():
    # Use custom domain
    driver = Driver('YOUR_TOKEN', base_url='https://custom-onlinesim.com')
    
    # Or use local development server
    driver_local = Driver('YOUR_TOKEN', base_url='http://localhost:8000')
    
    # Standard usage remains the same
    tzid = driver.numbers().get('service')
    print(tzid)


main()

Documentation

All documentation is in the wiki of this project - Documentation

Testing

The project includes comprehensive test coverage. All tests are located in the tests/ directory.

Running Tests

# Install test dependencies
pip install pytest pytest-cov pytest-mock

# Run all tests
python -m pytest tests/ -v

# Run specific test files
python -m pytest tests/test_basic_api.py -v
python -m pytest tests/integration_tests.py -v

# Run tests with coverage
python -m pytest tests/ --cov=onlinesimru --cov-report=html

For more detailed testing information, see tests/README.md.

Bugs

If you have any problems, please create Issues here

Metadata

Release files for onlinesimru 2.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for onlinesimru 2.1.3
File Size Uploaded
onlinesimru-2.1.3.tar.gz 17.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for onlinesimru 2.1.3
File Interpreter ABI Platform
onlinesimru-2.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 32.1 kB

Release files / onlinesimru-2.1.3.tar.gz

Download URL onlinesimru-2.1.3.tar.gz
Size 17.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7193be83bc28076a706d1326e495ea533a2f4e068c1ebf3244e6f260e1935317
BLAKE2b-256 checksum
How to use checksums
552aacb4a785447054b8e8bdc4bdc4e54137c39c4a5bfabedc6ad2b068a3b2f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / onlinesimru-2.1.3-py3-none-any.whl

Download URL onlinesimru-2.1.3-py3-none-any.whl
Size 15.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
85cb97d6c66c5e996f44b0cf83991b1f60cec59aac7b04380290bba0c676e1e8
BLAKE2b-256 checksum
How to use checksums
1130a69cf0d071ea68d276bc76fb730db132b7685d32740fc9ff061851243c5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

2.1.3 This release

2 release files

2.1.1

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

3 release files

1.0.19

2 release files

1.0.18

2 release files

1.0.17

2 release files

1.0.16

2 release files

1.0.15

2 release files

1.0.14

2 release files

1.0.13

2 release files

1.0.11

2 release files

1.0.10

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

3 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

4 release files

1.0.0

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page