Skip to main content

Simple package for file reading

Project description

PyFile

PyFile is a simple library which provides you some funcionalities for file reading and writing.

Install

from wosPyFile import pyFile

Files

PyFile is effective on simple text files, let's see some examples:

Reading

Read all

This will return all lines

pyFile.read("file.txt")

Read with conditions

This will return only lines that begins with the list elements

pyFile.read("file.txt", ["AAA", "BBB", "CCC"])

Extracting data from lines

Let's assume that we have a variable called line with the value bellow

ABC1234567

To extract data from this line, you can use pyFile.getLineData(), the second parameter is responsible to split the line in list elements

   pyFile.getLineData(line, [3,10])

Output:

["ABC", "1234567]

Matrix

If you have a defined range you can use pyFile.generateMatrix()

data = []
collumns = 240
size = 2
matrix = pyFile.generateMatriz(collumns, len(lines), size)
for index, line in  enumerate(lines):
    pyFile.getLineData(line, matrix[index])

A list element will be generated according with the interval defined in size

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

wosPyFile-2.0.0.tar.gz (2.0 kB view details)

Uploaded Source

Built Distribution

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

wosPyFile-2.0.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file wosPyFile-2.0.0.tar.gz.

File metadata

  • Download URL: wosPyFile-2.0.0.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for wosPyFile-2.0.0.tar.gz
Algorithm Hash digest
SHA256 14cac9967a6b0a5d8ee188b5493b77c386914ce2076505dd7cfd76424ff3b079
MD5 98dcd3f85f06bd2abf59e39594b456b3
BLAKE2b-256 7a99d75777ba91d893d60427d52c0fd61b0969a63935ca951e1680a261730372

See more details on using hashes here.

File details

Details for the file wosPyFile-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: wosPyFile-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for wosPyFile-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4de93c706bda125ca6e89d6db1436873bff6027233f3b130a0c4719f114bd1fd
MD5 9a6778fceb51924089f412354da65a17
BLAKE2b-256 001f3fe00af21768be9b2b629a07e15387f64378de52b6e2346003fb44e3af38

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