Skip to main content

Package mytable-lucien

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_lucien

Module 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.

Import

from mytable_lucien import mycsv

Function read()

This reads a CSV file and store the table in a list.

  • Usage
    res = mycsv.read(filename, 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
    List of rows. Each row is a list of columns, aka. cells, which contains strings.

Function write()

This creates 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 should be strings.
    • delimiter
      A char value. Comma by default. The character which is used to delimit the columns.
  • Returned value
    There are no returned values.

Module mytools

Useful tools. Simple, yet powerful.

Import

from mytable_lucien 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.

Module myview

This provides a better view of the tables.

Import

from mytable_lucien 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
    A table which contains the selected range.

Module myedit

Edit the table the easy way.

Import

from mytable_lucien import myedit

Function combine_rows()

This combines 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
    The combined table.

Function combine_columns()

This combines 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
    The combined table.

Release files for mytable-lucien 6.0.0

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

Source distribution (sdist)

Source distribution for mytable-lucien 6.0.0
File Size Uploaded
mytable-lucien-6.0.0.tar.gz 4.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mytable-lucien 6.0.0
File Interpreter ABI Platform
mytable_lucien-6.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.6 kB

Release files / mytable-lucien-6.0.0.tar.gz

Download URL mytable-lucien-6.0.0.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5953369c8ac66a32ccfc751ebfae1e15eddccd1aea6831fd0a366f1b97bfb935
BLAKE2b-256 checksum
How to use checksums
804a7112649b7205cdd065567cdb9aa7bf99ec0260baecbbad526eb585d0f6a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / mytable_lucien-6.0.0-py3-none-any.whl

Download URL mytable_lucien-6.0.0-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
904990c40d5258e855ab4060d14b2c88aa8cbe42e90fcd69e8895c9adf8a892b
BLAKE2b-256 checksum
How to use checksums
7058c9fe5a2e9738699cfe7a31d1af6797ccf2f8b7aaa9b2515e6b03c6c196e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release history Release notifications | RSS feed

This release

6.0.0 This release

2 release files

5.0.5

2 release files

5.0.4

2 release files

5.0.3

2 release files

5.0.2

2 release files

5.0.0

3 release files

4.6.4

2 release files

4.6.3

2 release files

4.6.2

2 release files

4.6.1

2 release files

4.6.0

2 release files

3.5.3

2 release files

3.5.2

2 release files

3.5.1

2 release files

3.5.0

2 release files

1.0

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