Skip to main content

File Mod

File mod is easy to perform file operations with the help of good method names

and less arguments to pass

Bug fix

1)fixed write specific line

2)much more faster now

Installation and Usage

  1. use pip install file-mod

  2. Make sure that your pip version is updated pip install --upgrade pip.

  3. Select the correct package for your environment:

  4. Import the package: import filemod

Functions in the module

  1. This is a file reader method reads file content and returns it as string

filemod.reader(filename)

  1. This file writer method writes contents to the file

filemod.writer(filename,content,method)

  1. This read_specific_line reads a specific line of the file and returns it as string

filemod.read_specific_line(filename,line)

  1. This extract_numbers_from reads a numbers from the file and returns all the collection of numbers in a list

filemod.read_specific_line(filename,line)

  1. This extracts the number of lines filemod.extract_numbers_from(filename)

  2. This delete a specific word from a file filemod.remove_word(filename,word)

  3. This delete a specific line from a file filemod.delete_specific_line(filename,line)

  4. This write a specific line from a file filemod.write_specific_line(filename,line)

Run Locally

Clone the project

  git clone https://github.com/kshitij1235/filemod/tree/main/dist

Install

  pip install filemod

List of Functions

| function name | Description| args |

| -------------------|------------|------------|

| Reader |Reads file | filename |

| writer |writes content to file|filename,content,method|

| read_specific_line |read_specific_line |filename,line|

|extract_numbers_from|extracts number form file|filename|

|remove_word |removes a specific word|filename,word|

|number_of_line |Get the number of lines in a file |filename|

|delete_specific_line|Delete a specific line |filename,line|

|write_specific_line |write a specific line |filename,line,content|

Usage/Examples

read file

import filemod



filemod.reader('demo_file.txt')

write file

import filemod



filemod.writer('demo_file.txt',content="new line ", method='w')

read_specific_line

import filemod



filemod.read_specific_line("demo_file.txt",1)

extract_numbers_from a file

import filemod



filemod.extract_numbers_from("demo_file.txt")

remove_word for a file

import filemod



filemod.remove_word("demo_file.txt","hello")

number_of_line

import filemod



filemod.number_of_line("demo_file.txt")

delete_specific_line

import filemod



filemod.delete_specific_line("demo_file.txt",1)

write_specific_line

import filemod

data="this is text"

filemod.write_specific_line("demo_file.txt",1,data)

Badges

MIT License

Authors

Metadata

Release files for filemod 2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for filemod 2.1
File Size Uploaded
filemod-2.1.tar.gz 4.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for filemod 2.1
File Interpreter ABI Platform
filemod-2.1-py3-none-any.whl Python 3 none any Details

Total release size: 9.5 kB

Release files / filemod-2.1.tar.gz

Download URL filemod-2.1.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e064c2c89536eede7523b9a1a6e0db6ccf983dd42f67dc93f4d7676aa54298fb
BLAKE2b-256 checksum
How to use checksums
77843239ffc9771a727432569df77efd4c0e10d6427a9c5a855c6bc0bcaa3380
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

Release files / filemod-2.1-py3-none-any.whl

Download URL filemod-2.1-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b03f4916b20819da236cc2affcbfd1c8bcb2df2438e988ef8683c9261a207589
BLAKE2b-256 checksum
How to use checksums
6d2abcfe925a31703fa2bb7c40440bdfc71d18ea6d2a3a60cc8f55ed1903b090
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

Release history Release notifications | RSS feed

This release

2.1 This release

2 release files

2

2 release files

1.8

2 release files

1.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page