Skip to main content

A lightweight and fast Python API for simplifying file operations

Project description

pyfastfile

A lightweight Python library for easy-to-use operations.


logo

python License Status Type Github

Installation

pip install pyfastfile

Usage

The encoding parameter defaults to utf-8 in all functions that support text encoding.
All index-based functions use zero-based indexing.

Titles


Main Functions

Function Name Description Arguments Returns
overwrite() Overwrites a file with given content. path:str, data:str,encoding:str None
append() Appends data to the end of a file. path:str, data:str,encoding:str None
read() Reads entire file content as string. path:str,encoding:str str
readlines() Returns file lines as a list. path:str, newline:bool,encoding:str list
getline() Returns a specific line from file. path:str, line:int,newline:bool,encoding:str str
exists() Checks if file exists. path:str bool
find() Returns lines containing target text. path:str,data:str,encoding:str list[str]
find_num() Returns line numbers matching target text. path:str,data:str,encoding:str list[int]
delete() Delete target file. path:str None
rename() Rename target file. path:str, name:str None
touch() Create file. path:str,existserror:bool None
move() Move files filepath:str,targetpath:str None
clear() Clears the content of a file by overwriting it with an empty string. path: str, encoding: str = "utf-8" None
count_lines() Returns the number of lines in a file. path: str int
size_mb() Returns file size in megabytes. path: str float
size() Returns file size in bytes. path: str int

Csv Functions

Function Name Description Arguments Returns
csv_read() Read target csv. path:str,encoding:str Generator
csv_append() Appends data to the end of a csv file. path:str,data:list,encoding:str None
csv_getheader() Return header of the target csv file. path:str,encoding:str list
csv_getrow() Return target row of the csv file. path:str,row:int,encoding:str list
csv_getcolumn() Return target column of the csv file. path:str,column:str,encoding:str list
csv_getdata() Gets a value from CSV by row and column. path:str,row:int,column:str,encoding:str, any
csv_updaterow() Update target row path:str,row:int,new_data:list,encoding:str None
csv_overwrite() Overwrite on target file. path:str,data:list,encoding:str None
csv_count() Return lenght of target file. path:str,withheader:bool int

Json Functions

Function Name Description Arguments Returns
json_read() Read target JSON file and parse its content. path:str dict
json_overwrite() Overwrite target JSON file with new data. path:str, data:dict, encoding:str None
json_append() Reads JSON file, merges new dictionary into existing data (key update behavior). path:str, data:dict None
json_delete_key() Deletes a specific key from JSON data and rewrites the file. path:str, key:str, encoding:str None
json_is_valid() Checks whether the target JSON file contains valid JSON data. path:str bool
json_get_values() Returns all values from the target JSON object. path:str, withlist:bool, encoding:str dict_values
json_get_keys() Returns all keys from the target JSON object. path:str, withlist:bool, encoding:str dict_keys

Utility Functions

Function Name Description Arguments Returns
destroy_newline() Removes newline characters from text. data:str str
lmap() Only: list(map(...)) func:function,lst:list list
copy_to_clipboard() Copy text on clipboard text:str None

Project Repo GithubProject Repo PyPI -- Author Github ProfileAuthor PyPI Profile

--Batuhan Şenol

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

pyfastfile-0.3.1.post2.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

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

pyfastfile-0.3.1.post2-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

Details for the file pyfastfile-0.3.1.post2.tar.gz.

File metadata

  • Download URL: pyfastfile-0.3.1.post2.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for pyfastfile-0.3.1.post2.tar.gz
Algorithm Hash digest
SHA256 60f87aa36d9437fba1e9698891ad9eca78078d980bac8e816e2cd932e53f1cc9
MD5 75cd8acd8d58c475342d04bfce572058
BLAKE2b-256 f3eb54a04a072cd921300f5a3d3b7534991e81925e3a56f99d47920393694136

See more details on using hashes here.

File details

Details for the file pyfastfile-0.3.1.post2-py3-none-any.whl.

File metadata

File hashes

Hashes for pyfastfile-0.3.1.post2-py3-none-any.whl
Algorithm Hash digest
SHA256 df7606383c2b7da5069943171c4d008ce67c87b62366135d2242c25a91e1141c
MD5 b2df88308d06730f3424568c04807ec5
BLAKE2b-256 f628bbe87c2e7bea7025f02d39490cb5aa79588dcb729b0a62f0eabf08e05735

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