Skip to main content

No project description provided

Project description

important

🎁 Import Ant 🐜 The folder of python functions and classes we can import

PyPI version test pypi build

import ant avatar

📦 Installation

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

🧱 Databricks

Within Databricks notebooks, we can do:

import sys
sys.path.append("/Workspace/Repos/ray@fireworkhq.com/important/src")

🔌 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


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.2.tar.gz (16.8 kB view hashes)

Uploaded Source

Built Distribution

import_a-0.0.2-py3-none-any.whl (14.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page