ted17 package¶
Submodules¶
ted17.dategr module¶
dategr - A library to work with Greek Format Dates¶
dategr is a libray that provides a set of functions to work with Greek Formatted Dates.
-
ted17.dategr.
date2gr
(date, removezero=False)[source]¶ Parameters: - date (iso_date) – iso date ‘yyyy-mm-dd’
- removezero – Month, Day without trailing zeros (If True ‘2017-01-09’ => ‘9/1/2017’. If False ‘2017-01-09’ => ‘09/01/2017’)
Returns: ‘dd/mm/yyyy’
Example:
>>> import dategr >>> dategr.date2gr('2017-01-15) '15/01/2017' >>> dategr.dat2gr('2017-01-15, True) '15/1/2017'
-
ted17.dategr.
getymd_from_iso
(isodate)[source]¶ Year, month, day From isodate
Parameters: isodate – Date of the form ‘yyyy-mm-dd’ Returns: int year, int month, int day
-
ted17.dategr.
grdate2iso
(greek_date)[source]¶ Return iso date (yyy-mm-dd) from greek date(dd/mm/yyyy)
Parameters: greek_date – Date of the form ‘dd/mm/yyyy’ Returns: Iso Date (‘yyyy-mm-dd’)
-
ted17.dategr.
group_selector
(iso_date, per='m')[source]¶ Selector
Parameters: - iso_date – Iso Date to transform
- per – Text value according to following table
per Time Interval m month d full date y year m2 Βimonthly m3 Quarter m4 Quadrimester m6 Semester w Week s Season
-
ted17.dategr.
period
(iso_date, diast=2)[source]¶ Find the timespace iso_dete belongs
Parameters: - iso_date – Date of the form ‘yyyy-mm-dd’
- diast – Time space
Returns: ‘year-diast-diastv’
ted17.db module¶
Module db.py Connect to sqlite database and perform crud functions
Example:
>>> from ted17 import db_context_manager as dbc
>>> with dbc.SqliteManager('path/to/sql3file') as db:
>>> db.select('SELECT * from tbl1')
-
class
ted17.db.
SqliteManager
(dbfile)[source]¶ Bases:
object
Context manager class
-
dbf
= None¶ This is a test
-
fields
(table_or_view)[source]¶ A Tuple with table or view fields
Parameters: table_or_view – Table or View name
-
script
(sqlscript)[source]¶ Execute an sql script against self.dbf
Parameters: sqlscript – SQL to run Returns: Nothing
-
select
(sql)[source]¶ Get a list of tuples with data
Parameters: sql – SQL to run Returns: List of tuples of rows
-
select_as_dict
(sql)[source]¶ Get a list of dictionaries
Parameters: sql – The sql to execute Returns: [{}, {}, ...]
-
select_master_detail
(idv, tablemaster, tabledetail=None, id_at_end=True)[source]¶ Get a specific record from table tablemaster. If we pass it a tabledetail value, it gets detail records too.
Parameters: - idv – id value of record
- tablemaster – Master table name
- tabledetail – Detail table name
- id_at_end – If True Foreign key is like tablemaster_id else is like id_mastertable
Returns: dictionary with values
-
select_with_names
(sql)[source]¶ Get a tuple with column names and a list of tuples with data
Parameters: sql – The sql to execute Returns: (columnNam1, ...) [(dataLine1), (dataLine2), ...]
-
set_application_id
(idv)[source]¶ Set application_id to database file
Parameters: idv – application_id value to set Returns: nothing
-
ted17.db_sql module¶
Module db_sql.py Creates insert, update, delete sql from dictionaries
-
ted17.db_sql.
dic2sql
(table, adic)[source]¶ Dictionary to Sql.
Parameters: - table – Table name
- adic – dictionary with key names same with table field names
Returns: sql according to input parameter adic.
If adic[‘id’] == 0 returns insert sql
If adic[‘id] != 0 returns update sql
If there is adic[‘_d_’] returns delete sql
ted17.dbmanager module¶
Module dbmanager.py
-
class
ted17.dbmanager.
Dbmanager
(user_version, application_id)[source]¶ Bases:
object
Dbmanager class
-
add_table
(table, label, labelp, rpr=[], unifld=[])[source]¶ Adds a new table table : The table Name label : The translated title of table labelp : The translated plural title of table rpr : List of table representation fields unifld : List of fields to be unique
-
get_fields
(table, with_id=True)[source]¶ - Returns an ordered list with table fields
- with_id=True : [‘id’, ‘fld1’, ‘fld2’, ...] with_id=False : [‘fld1’, ‘fld2’, ...]
-
get_labels
(table)[source]¶ Returns a dictionary with fields: labels of table {‘fld1’: ‘lbl1’, ‘fld2’: ‘lbl2’, ...}
-
ted17.dec module¶
-
ted17.dec.
dec
(poso=0, decimals=2)[source]¶ Always returns a decimal number. If poso is not a number or None returns dec(0)
Parameters: - poso – Mumber in any format (string, float, int, ...)
- decimals – Number of decimals (default 2)
Returns: A decimal number rounded to decimals parameter
-
ted17.dec.
dec2gr
(poso, decimals=2, zero_as_space=False)[source]¶ Returns string with Greek Formatted decimal (12345.67 becomes 12.345,67)
-
ted17.dec.
distribute
(val, distArray, decimals=2)[source]¶ input parameters:
Parameters: - val – Decimal value for distribution
- distArray – Distribution Array
- decimals – Number of decimal digits
Returns: Tuple of distributed val
ted17.f_find module¶
ted17.f_table module¶
-
class
ted17.f_table.
Form_find
(lbls, rws, title, parent=None, selectAndClose=True)[source]¶ Bases:
PyQt5.QtWidgets.QDialog
-
valselected
¶
-
ted17.grup module¶
Module grup
ted17.parameters module¶
ted17.rpt_html module¶
Created on 5 Μαρ 2013 Updated on 26 Mar 2017 @author: tedlaz
ted17.w_checkbox module¶
ted17.w_date module¶
ted17.w_date_or_empty module¶
ted17.w_integer module¶
-
class
ted17.w_integer.
Integer
(val='', parent=None)[source]¶ Bases:
ted17.w_textline.Text_line
Text field with numeric chars only left aligned.
ted17.w_integer_spin module¶
ted17.w_numeric_old module¶
ted17.w_numeric_spin module¶
ted17.w_text module¶
ted17.w_text_button module¶
Created on Nov 25, 2014
@author: tedlaz.
Bases:
PyQt5.QtWidgets.QWidget
Button text class
ted17.w_text_button_old module¶
Created on Nov 25, 2014
@author: tedlaz.
Bases:
PyQt5.QtWidgets.QLineEdit
Button text class
ted17.w_text_combo module¶
ted17.w_textline module¶
ted17.w_textline_numbers_only module¶
-
class
ted17.w_textline_numbers_only.
Textline_numbers_only
(val='', parent=None)[source]¶ Bases:
ted17.w_textline.Text_line
Text field with numeric chars only left aligned.
ted17.w_tree module¶
-
class
ted17.w_tree.
Treemodel
(root, headers, parent=None)[source]¶ Bases:
PyQt5.QtCore.QAbstractItemModel