Skip to main content

Used to store variables permanently, which can be read directly after importing into the library.

Project description

Permanent Variable Tool

中文文档请往下查看


pvt.new(variable:str, value:Any=None) -> None

Functionality

Creates/updates variable files in ./data/ directory

Usage Example

pvt.new("user_profile", {"name": "John", "age": 28})  # Serializes to string 
pvt.new("system_flag")   # Creates empty file 

pvt.read(variable:str) -> str

Critical Notes

  • Always wrap in try-except:
try:
    config = pvt.read("app_config")
except FileNotFoundError:
    initialize_defaults()

pvt.delete(variable:str) -> None

Security Notice

  • Deletion is permanent. Recommended safety check:
if os.path.exists(pvt.data_dir + "/" + variable + ".var"):
    pvt.delete("temp_data") 

pvt.find (variable name: str) -> Bool

Use examples

Bool = pvt.find(str)
print(Bool) # True / False


永久变量工具 (Permanent Variable Tool)

Please check the English documents up.


pvt.new(变量名:str, 值:Any=None) -> None

功能 在./data/目录中创建/更新变量文件

使用示例

pvt.new("user_profile", {"name": "张三", "age": 28})  # 序列化为字符串 
pvt.new("system_flag")   # 创建空文件

pvt.read(变量名:str) -> str

重要说明

  • 必须使用try-except包裹:
try:
    config = pvt.read("app_config")
except FileNotFoundError:
    initialize_defaults()

pvt.delete(变量名:str) -> None

安全提示

  • 删除操作不可逆。建议进行安全检查:
if os.path.exists(pvt.data_dir + "/" + variable + ".var"):
    pvt.delete("temp_data")

pvt.find(变量名:str) -> Bool

使用示例

Bool = pvt.find(str)
print(Bool) # True / False

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

permanent_variable_tool-1.0.3.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

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

permanent_variable_tool-1.0.3-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file permanent_variable_tool-1.0.3.tar.gz.

File metadata

  • Download URL: permanent_variable_tool-1.0.3.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for permanent_variable_tool-1.0.3.tar.gz
Algorithm Hash digest
SHA256 66ded145d2b6a862b09feee00981fd6166130af83f13e4e143a689bde5b62801
MD5 080e6b3887087173b8edbcba189648f2
BLAKE2b-256 7e13e6e98303b64fa0e19a5c65afb183799d3275b2ecb2472e055d8e14ad940b

See more details on using hashes here.

File details

Details for the file permanent_variable_tool-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for permanent_variable_tool-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 06f652e89b0c6b8b0c685dc7d3b06ad084b5cf7dd1bbdc7d994a8f1eca81340d
MD5 f313474da920952269ad08f25c15e0c3
BLAKE2b-256 bb6e1998da9f09ed9eaeeea78811fd855d50d46209ee4f438f95b3a4f94086da

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