Skip to main content

A simple package for processing data in the form of a table.

Project description

MYTABLE

A simple package for processing data in the form of a table.

Pay attention, all indexes start from 0 instead of 1.

To install:

pip install mytable-lucien

To import:

import mytable

MYCSV

This is a simple reader and writer for CSV files by Lucien Shaw. It consumes less resource and processes more quickly than the current csv module, though a lot less functional.

It reads CSV files as plain texts and stores the table in a list, whose elements are lists of cells of the current row. The list is the value to the key 'full' of a dict, which is the returned value of the function.

Here is the guidance.

To import

from mytable import mycsv

Function: read()

Read a CSV file and store the table in a list.

  • usage
res = mycsv.read(filname, delimiter=',')
  • arguments
    • filename

      A string value. The filename of the CSV file.

    • delimiter

      A char value. Comma by default. The character which is used to delimit the columns.

  • returned value
    • res

      List of rows. Each row is a list of columns, aka. cells, which contains strings.

Function: write()

Create a CSV file.

  • usage
mycsv.write(filename, table, delimiter=',')
  • arguments

    • filename

      A string value. The filename of the CSV file to be written.

    • table

      A list, the structure of which is the same as the value to the key 'full' of the returned dict of function read().

      All values shall be strings.

    • delimiter

      A char value. Comma by default. The character which is used to delimit the columns.

  • returned value

    There is no returned value.

MYTOOLS

Useful tools. Simple, but powerful.

To import

from mytable import mytools

Function: excel_ctn()

All functions of this package use numbers as indexes, but Excel uses alphabets as indications of the columns, such as 'A' for column 0 (We count from 0, remember?), 'Z' for column 25, and 'AA' for column 26.

This converts the alphabetical column Characters To pure Numbers.

  • usage
res = mytools.excel_ctn(col)
  • arguments

    • col

      Alphabetical column characters, such as 'A' or 'AA', etc.

  • returned value

    A number, as mentioned above.

MYVIEW

Provide a better view of the tables.

To import

from mytable import myview

Function: select_range()

In some circumstances, there are so many columns that they cannot be fully displayed in excel, and columns that exceed the limit cannot be visualized.

This allows you to select some columns and rows so that you can extract them to a new temporary CSV file and view them with your favorite table viewer, like Excel.

  • usage
table_select = myview.select_range(table, columns=[], rows=[])
  • arguments
    • table

      An original table in the form of a list.

    • columns

      A list of column numbers that indicate the columns you would like to see. The default value is an empty list, which selects all columns.

    • rows

      A list of row numbers that indicate the rows you would like to see. The default value is an empty list, which selects all rows.

  • returned value
    • table_select

      A table which contains the selected range.

MYEDIT

Edit the table the easy way.

To import

from mytable import myedit

Function: combine_rows()

Combine rows of multiple tables with the same total number of columns.

  • usage
comb = myedit.combine_rows(tables)
  • arguments
    • tables

      A list which contains multiple tables.

  • returned value
    • comb

      The combined table.

Function: combine_columns()

Combine columns of multiple tables with the same total number of rows.

  • usage
comb = myedit.combine_columns(tables)
  • arguments
    • tables

      A list which contains multiple tables.

  • returned value
    • comb

      The combined table.

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

mytable-lucien-5.0.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distributions

mytable_lucien-5.0.0-py3.10.egg (10.2 kB view details)

Uploaded Source

mytable_lucien-5.0.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file mytable-lucien-5.0.0.tar.gz.

File metadata

  • Download URL: mytable-lucien-5.0.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for mytable-lucien-5.0.0.tar.gz
Algorithm Hash digest
SHA256 8cb11a18abc53fb711fce92dbb4d7e8ee45f67a4b2af209e8a4d2e509180eda5
MD5 44c2d28e1809a1be6c2c1dd79d9d01f1
BLAKE2b-256 f51c4a79f95e2ea6b3a81eadb4f863b765c619ba604d18e57dedc05d59a16f4f

See more details on using hashes here.

File details

Details for the file mytable_lucien-5.0.0-py3.10.egg.

File metadata

  • Download URL: mytable_lucien-5.0.0-py3.10.egg
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for mytable_lucien-5.0.0-py3.10.egg
Algorithm Hash digest
SHA256 e7982ad8a75d5826c24a56dee29a3deb6572698d420f9525c9ae26e15b70b4ae
MD5 5ffcabf61c9a11080c55bbd78ef6ea42
BLAKE2b-256 8f8e04d36d2bc153d05f21e9d7b7c8844ae80c485e34fa3af7f0b13e6e840b91

See more details on using hashes here.

File details

Details for the file mytable_lucien-5.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mytable_lucien-5.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 554247fc1e21c6a8c7fc9abe751bc785c0b16cf23cc6d74c729d0ea7caf63249
MD5 697e1202e350c8c519c11d647b2bdee3
BLAKE2b-256 29277b2b45574f393e1fd4fd5e1daf886c5d33c2aedafcf067511b4e1cca50d5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page