Skip to main content

A Python package keeping the values of variables between separate runs in a seamless and effortless way.

Project description

keepvariable

A Python package keeping the values of variables between separate runs in a seamless and effortless way.

Installation

Use the package manager pip to install keepvariable.

pip install keepvariable

Usage with Redis

import keepvariable_core as kv
import pandas as pd

kv_redis=kv.KeepVariableRedisServer(host="127.0.0.1",port=6379)
    

kv_redis.set("test","abc123")
result=kv_redis.get("test")

print(result) 
#abc123



#even pandas dataframes, and numpy arrays can be stored
df=pd.DataFrame([[1,2,3,4],[4,5,6,7]],columns=["a","b","c","d"])    
array=df.values    

    
kv_redis.set("test_df",df)
result=kv_redis.get("test_df")

print(result)
#   a  b  c  d
#0  1  2  3  4
#1  4  5  6  7
    
kv_redis.set("test_array",array)
result=kv_redis.get("test_array")

print(result)
# #[[1 2 3 4]
# # [4 5 6 7]]

Usage (locally)

from keepvariable_core import Var,kept_variables,save_variables,load_variable

a=Var("b")
b=Var("c")

c=a+b

print(c)

dict1=Var({1,2,3,4,5})

list1=Var(a)

print(kept_variables)
save_variables(kept_variables)

list1=load_variable()

b=load_variable()

c=Var(c)
print(list1)

obrazek

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

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

keepvariable-1.2.15.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

keepvariable-1.2.15-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file keepvariable-1.2.15.tar.gz.

File metadata

  • Download URL: keepvariable-1.2.15.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for keepvariable-1.2.15.tar.gz
Algorithm Hash digest
SHA256 0ede2584117d2c3927fc451f897efc4c94660c6c6fb8322fec0e50c4f6ad734f
MD5 71adcc93e74da9657f4e925c0c730cde
BLAKE2b-256 2c49ba97f0b1c05358aee55820f69e9963a7a8fdd0c24962a49744ec7e5760cc

See more details on using hashes here.

File details

Details for the file keepvariable-1.2.15-py3-none-any.whl.

File metadata

  • Download URL: keepvariable-1.2.15-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for keepvariable-1.2.15-py3-none-any.whl
Algorithm Hash digest
SHA256 659443a73951078f23e170cb206bfd17bff4099fa702445cd36e55affe3c615e
MD5 fb82f165653c471bc6da02f161c75b39
BLAKE2b-256 e0f75cb0274041445201896d25d677e333a178450eb315e62ff9a844aba701cc

See more details on using hashes here.

Supported by

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