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
import_a-0.0.21.tar.gz
(73.9 kB
view details)
Built Distribution
import_a-0.0.21-py3-none-any.whl
(74.8 kB
view details)
File details
Details for the file import_a-0.0.21.tar.gz
.
File metadata
- Download URL: import_a-0.0.21.tar.gz
- Upload date:
- Size: 73.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 308e0bfbdcca5af20ad864bc7fcb7188d710968312540babd051cf1c0fbe2d2d |
|
MD5 | b53448b5f8090e7d0cb80c7e706b7487 |
|
BLAKE2b-256 | 28498e72c60d14f18e14b2be70b5b3b6ebef4929e378ab91ac2da35b98aac0f3 |
File details
Details for the file import_a-0.0.21-py3-none-any.whl
.
File metadata
- Download URL: import_a-0.0.21-py3-none-any.whl
- Upload date:
- Size: 74.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c642ed4369759cf5649a02fadc4ac62ee4303347ff9d54ef6705616ad04fdc2 |
|
MD5 | a37fac4192afb71bab4d0dd8f69191d4 |
|
BLAKE2b-256 | 0cca33647f7fa4d4e76f2a955d68772a2c9c2aa6986c174848c2881ddb7f3fd1 |