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.8.tar.gz (12.6 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.8-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: keepvariable-1.2.8.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for keepvariable-1.2.8.tar.gz
Algorithm Hash digest
SHA256 1f2439eb77a31e56b0c212b482e11b8627cd647837e68a818245c4555e3a2145
MD5 f3c507e90380f13b46f570b0643e006b
BLAKE2b-256 bb78f2973d10d851ba4c94906e2924d907e3ab5617bec2dcaeba5b9a07733dde

See more details on using hashes here.

File details

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

File metadata

  • Download URL: keepvariable-1.2.8-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for keepvariable-1.2.8-py3-none-any.whl
Algorithm Hash digest
SHA256 0b835e1a52d3712fa44d1181b49fd081e45577c0359443a2ff8bf73add80bdff
MD5 4841bc12f2c4a9ab5bc093b52c7781da
BLAKE2b-256 b695ab57aee033d58fda372b6445f1584c01c9f470a0876d27e5619d72147dfb

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