Skip to main content

Parser for schedule petrocollege

Project description

Simple parser portal (SharePoint) petrocollege

Installation

pip install schedule_parser_portal_petrocollege

Use SharePoint сlass

Create object of class SharePoint

import SharePoint

share_point = SharePoint(username, password)

Send any Request to server

# Return Response JSON result
result = share_point.get_request_json(<some_url>)

Get json object elements of List

# result make list of title and link elements 

links = share_point.get_data_from_lists_type(result)

print(links)

#[            {
#                "title": Title,
#                "link" : "Lists(guid'9c095153-274d-4c73-9b8b-4e3dd6af89e5')/Items(16)"
#            }
#]

Get files (AttachmentFiles)

# url_list is a link like "Lists(guid'9c095153-274d-4c73-9b8b-4e3dd6af89e5')/Items(16)"
files = share_point.get_data_from_attachment_files_type((share_point.get_request_json(<url_list> + "/AttachmentFiles")))

#save files 

for file in files:
    share_point.save_file_by_url(file['ServerRelativeUrl'], file['FileName'], 'files')

Get dict from file

import File
file = ExcelFile('<path_to_xlsx_file>')
data = file.get_object()

return dict like

{
            'teacher': 'Ярошенко С.П.',
            'debug_column': 324,
            'teacher_lessons':
                [
                    {
                        'lesson':
                            {
                                'discipline': 'Теор.гос.и права',
                                'room': '101',
                                'building': '4',
                                'groups': ['11-29'],
                                 '_Lesson__current_string': 'Теор.гос.и права  4/101',
                                'is_dop': False,
                                'subgroup': 0
                            },
                            'date_lesson': datetime.datetime(2022, 9, 1, 0, 0),
                            'number_of_lesson': 2,
                            'debug_position_row': 21,
                            'debug_position_column': 324,
                            'debug_position_coordinate': 'LL21'
                            }
                    }
                    ...
                ]
        }

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

schedule_parser_portal_petrocollege-0.0.2.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file schedule_parser_portal_petrocollege-0.0.2.tar.gz.

File metadata

File hashes

Hashes for schedule_parser_portal_petrocollege-0.0.2.tar.gz
Algorithm Hash digest
SHA256 9edb66ad2807efed31d0ab3a3276f94c0201b7e6042df77645ed4b06ae72aa60
MD5 c21685799783c07afc6c97811898fbf9
BLAKE2b-256 818433aba560fd4da0e84e6527f67c2a47b193de76a04cee51363ac0693f90fc

See more details on using hashes here.

File details

Details for the file schedule_parser_portal_petrocollege-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for schedule_parser_portal_petrocollege-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5cd7e9a8a6781d5c9852b31f0768a93ce73245d7258f0c14050ef0a7c4cefebf
MD5 98c787a8f6ee2de7a6bc844da2e40ad7
BLAKE2b-256 27dfa5105f0cede42d3c6e6b11e59ea91602df0754ba974c2c125ac02eba2181

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