Server IP : 192.158.238.246 / Your IP : 3.137.184.32 Web Server : LiteSpeed System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64 User : jenniferflocom ( 1321) PHP Version : 8.1.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/alt/python38/lib64/python3.8/site-packages/playhouse/__pycache__/ |
Upload File : |
U S��WX- � @ s� d Z ddlZddlZddlZddlZddlmZ zddlmZ W n ek r` ddl mZ Y nX ddl T ddl mZ ddl mZ ddl m Z e r�eZd Znd ZG dd� de�Zd d� ZG dd� de�ZG dd� de�Zddd�Zej e_ ddd�ZdS )a Peewee helper for loading CSV data into a database. Load the users CSV file into the database and return a Model for accessing the data: from playhouse.csv_loader import load_csv db = SqliteDatabase(':memory:') User = load_csv(db, 'users.csv') Provide explicit field types and/or field names: fields = [IntegerField(), IntegerField(), DateTimeField(), DecimalField()] field_names = ['from_acct', 'to_acct', 'timestamp', 'amount'] Payments = load_csv(db, 'payments.csv', fields, field_names) � N)�contextmanager)�StringIO)�*)�Database)�Func)�PY3FTc @ s e Zd Zedd� �ZdS )� _CSVReaderc k sj d}t |t�rt|d�}n,t |t�r4|}|�d� n|}|�d� d}tj|f|�}|V |rf|�� d S )NF�rr T)� isinstance� basestring�openr �seek�csv�reader�close)�self�file_or_name� reader_kwargs�is_file�fhr � r �F/opt/alt/python38/lib64/python3.8/site-packages/playhouse/csv_utils.py� get_reader'