SwitchKeys Python Client
The SwitchKeys Python Client provides a convenient way to interact with the SwitchKeys API using Python applications. This README provides an overview of the SwitchKeys Python Client, its installation process, usage instructions, and additional resources.
Table of Contents
Installation
To install the SwitchKeys Python Client, you can use pip, Python's package manager. Run the following command in your terminal:
pip install switchkeys
Usage
To use the SwitchKeys Python Client in your Python application, you need to import the necessary modules and initialize a SwitchKeys instance with your API token. If you don't have an API token yet, you can use the authentication methods provided by the client to obtain one and save it in a config.ini file for future use.
Initializing SwitchKeys Instance
from switchkeys.core.base import SwitchKeys
# If you already have an API token
switch_key = SwitchKeys(api_token="YOUR_API_TOKEN_HERE")
# If you don't have an API token yet
# Use the auth.login method to obtain tokens and save them in the config.ini file
# Or use the auth.register method to create a new user and obtain tokens
# Then initialize the SwitchKeys instance with the obtained tokens
Authentication Methods
Logging In
user = switch_key.auth.login(email="your_email@example.com", password="your_password")
# Set the token on the switchkeys instance.
SWITCH_KEY_API_TOKEN = user.access_token
switch_key.api_token = SWITCH_KEY_API_TOKEN
Registering a New User
user = switch_key.auth.register(
email="new_user@example.com",
first_name="New",
last_name="User",
password="password123"
)
# Set the token on the switchkeys instance.
SWITCH_KEY_API_TOKEN = user.access_token
switch_key.api_token = SWITCH_KEY_API_TOKEN
After obtaining the tokens, they will be automatically saved in the config.ini file for future use.
Examples
The SwitchKeys Python Client comes with several examples to demonstrate its usage for various functionalities, such as authentication, managing organizations, projects, users, etc. You can find these examples in the examples directory of the repository.
To run the examples, navigate to the examples directory and execute the Python scripts. For example:
cd examples
python auth_example.py
Documentation
For detailed documentation on how to use the SwitchKeys Python Client, including available methods, parameters, and usage examples, please refer to the official documentation.
For more detailed documentation and usage examples, please refer to the official documentation.
Contributing
Contributions to the SwitchKeys Python Client are welcome! If you encounter any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request on the GitHub repository.
Before contributing, please review the contribution guidelines.
License
The SwitchKeys Python Client is licensed under the MIT License.
Metadata
Release files for switchkeys 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| switchkeys-0.1.2.tar.gz | 13.6 kB | Without provenance | Details for switchkeys-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| switchkeys-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for switchkeys-0.1.2-py3-none-any.whl |
Total release size: 32.1 kB
Release files / switchkeys-0.1.2.tar.gz
| Download URL | switchkeys-0.1.2.tar.gz |
|---|---|
| Size | 13.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3ebeb7d9aba8038569e670532e797360b4951292c2ecdd82cee2fa2878110b9a
|
|
BLAKE2b-256 checksum How to use checksums |
4c7a82ca900b12ae48b44fc4a2afbcb73a1d03a75ef2c60d41fffa05d561abb7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.10.12 Linux/6.5.0-26-generic
|
Release files / switchkeys-0.1.2-py3-none-any.whl
| Download URL | switchkeys-0.1.2-py3-none-any.whl |
|---|---|
| Size | 18.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cc85d005303bece1ae59d0079dd104bce6e2850a7f354eb032f09c2324e98f37
|
|
BLAKE2b-256 checksum How to use checksums |
ec77354319c75b82af367074a494d3ad1dfee958f321cffbd65b4bace7c8656c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.10.12 Linux/6.5.0-26-generic
|
Security for switchkeys 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.