A folder of functions and classes that are easy to import
Project description
important
🎁 Import Ant 🐜 The folder of python functions and classes we can import
📦 Installation
Import Ant is meant to be as light weight as possible, say you want to import some re-useable code for redis, but you don't want to install every dependency for kafka, snowflake, etc. You can install just the redis part with out worring to manage the distribution about anything else.
Very simple version
pip install import-a
With other distributions
pip install "import-a[redis]"
or
pip install "import-a[kafka,redis]"
pip install "import-a[kafka,snowflake]"
or just get greedy and install everything, with a specified version 🚀🏎💣🔪🔫🔨🧨🧱🧲🧪🧬🧯🧰
pip install "import-a[all]==0.0.1"
🔌 Connectors
❄️ Snowflake
from important.snowflake import SnowFlakeDatabricks
sf = SnowFlakeDatabricks.from_config()
# read data into a pandas dataframe
df = sf("SELECT * FROM some_table")
🍄 Redis
from important.redis import Redis, RedisAsync, RedisController
Vanilla Redis
# connect to redis
redis_client = Redis(host="localhost", db=0)
control = RedisController.from_task(redis_client, task="channel_pop")
# save data by key
control[dict(channel_id=137, user_id=424242)] = "Some string data"
Async Redis
redis_client = RedisAsync(host="localhost", db=0)
control = RedisControllerAsync.from_task(
redis_client, task="channel_pop")
# save data by key, sadly the await expression doesn't support the [] syntax
await control.set(dict(channel_id=137, user_id=424242), "Some string data")
# get data by key
await control[dict(channel_id=137, user_id=424242)]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file import-a-0.0.17.tar.gz.
File metadata
- Download URL: import-a-0.0.17.tar.gz
- Upload date:
- Size: 76.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9101138d25cd551c9255f30c87a3636884eb38d90823c120d810df8d44ab29ee
|
|
| MD5 |
382a871cf821867ea599a4e1c989a3b2
|
|
| BLAKE2b-256 |
6973cd2f40439a512332f50314250b07851ea0604df2bc65dc5a7bb9c0c0eb3d
|
File details
Details for the file import_a-0.0.17-py3-none-any.whl.
File metadata
- Download URL: import_a-0.0.17-py3-none-any.whl
- Upload date:
- Size: 77.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c78ad63ed1179b030dfbc513b93985557e43d80491b138da71410cf365385e41
|
|
| MD5 |
1568150db6f0c72fe175f62d56c5489b
|
|
| BLAKE2b-256 |
3064d93818bc3a5d8e18092ffd0241b0625376e59b45776d96146184cfd0474e
|