Skip to main content

Py Cortex Intelligence

Release Notes

Need to consult the history of our project? Click Here

How to build locale

pip install wheel
python setup.py bdist_wheel

How to update on PIP

python -m twine upload  dist/*

Cases of Use

DataInput Parameters

data_input_parameters = {
    'ignoreValidationErrors': True/False,
}
// If you send this parameter, the datainput will ignore errors.

Available Origins

execution_parameters = {
  'name': 'Name of your Integrations',
  'origin': 'Connector',
}

// If you send this to Execution your data need contain
// Dates in YYYY-MM-DD HH:MM:SS format
// Float numbers in XXX.XXX.XXX,YY format
// 'origin' are optional parameters, if you do not send the platform you will try to guess the formats

If you need upload a file to Cortex Application

import logging.config
from pycortexintelligence import functions as cortexfunctions

## Criamos uma instancia do filter
cortexFilter = cortexfunctions.ApplicationTenantFilter(
    'App_Using_Pycortexintelligence',
    'CLIENT'
)

## Configurando o logging do sistema
LOGGING = {
    'version': 1,
    'disable_existing_loggers': True,
    'formatters': {
        'verbose': {
            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
        },
    },
    "handlers": {
        'console':{
            'class': 'logging.StreamHandler',
            'formatter': 'verbose'
        },
        ## Entrada do handler do Graylog utilizando graypy
        ## Para utilizar esse handler eh necessario instalar o graypy 
        ## no requirements.txt de sua aplicacao ou com pip install graypy
        'graypy': {
            'class': 'graypy.GELFUDPHandler',
            'host': 'localhost',
            'port': 12201,
            'filters': [cortexFilter]
        }
    },
    "root": {
        "handlers": ["console", "graypy"],
        "level": "DEBUG",
    }
}
## Configuring Logging
logging.config.dictConfig(LOGGING)

# Execution Parameters
# You can define Origin, to inform platform a bundle of parses.
execution_parameters = {
    'name': 'LoadManager PyCortex',
    # 'origin': 'Connector',
}

# DataInput Parameters
data_input_parameters = {
    'ignoreValidationErrors': True,
}

# Timeouts
# You can set timeouts for the platform according to the size of the uploaded files
# or use the default
timeout = {
    'file': 300
}

# DataFormat are Optionally defined
default_data_format = {
    "charset": "UTF-8",
    "quote": "\"",
    "escape": "\\",
    "delimiter": ",",
    "fileType": "CSV",
    "compressed": "NONE"
}

try:
    # Upload to Cortex
    cortexfunctions.upload_to_cortex(
        cubo_id='',
        file_path='',
        plataform_url='CLIENT.cortex-intelligence.com',
        username='',
        password='',
        data_format=default_data_format,
        timeout=timeout,
        execution_parameters=execution_parameters,
    )
except Exception as e:
    # In case of error, send it to logger
    logging.error(str(e))

If you need download file from Cortex Application

from pycortexintelligence import functions as cortexfunctions

# DataFormat are Optionally defined
dafault_data_format = {
    "charset": "UTF-8",
    "quote": "\"",
    "escape": "\/\/",
    "delimiter": ",",
}

# Select the headers from file
columns = ['Name of Column A', 'Name of Column B']

# OPTIONAL Filters
filters = [
    ['Name of Column A', 'Value'],
    ['Name of Column A', 'Value1|Value2|Value3'],
    ['Name of Column B', 'dd/mm/YYYY'],
    ['Name of Column B', 'dd/mm/YYYY-dd/mm/YYYY'],
]

# Download from Cortex
cortexfunctions.download_from_cortex(
    cubo_id='',
    file_path='',
    plataform_url='CLIENT.cortex-intelligence.com',
    username='',
    password='',
    data_format=dafault_data_format,
    columns=columns,
    filters=filters,
)

Validating downloaded data from platform.

Now download_from_cortex function returns a variable with Content-Rows from the response header

content_rows = cortexfunctions.download_from_cortex(
    ...
)

CLI Usage

cortex.py --help

Examples

cortex.py startproject --name "Project Name" --sname safe_project_name

How to Contribute

Developers

Developers can access our development manual by clicking here.

Community

You can create a new Issue clicking here, and we will start a description about the reported Bug or Feature.

Release files for pycortexintelligence 1.2.7

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

Built distribution (wheel)

Table of built distributions (wheels) for pycortexintelligence 1.2.7
File Interpreter ABI Platform
pycortexintelligence-1.2.7-py3-none-any.whl Python 3 none any Details

Release files / pycortexintelligence-1.2.7-py3-none-any.whl

Download URL pycortexintelligence-1.2.7-py3-none-any.whl
Size 16.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9e62d630551b8793336d3bad6c1ddc24926c6393f2f1e16d1d89b28fd700d02f
BLAKE2b-256 checksum
How to use checksums
1cb5261d285102298ea47c86842df6b4436273f8c0cb66f46f188c4d02770373
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.7.13

Release history Release notifications | RSS feed

This release

1.2.7 This release

1 release file

1.2.2

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.1.0

1 release file

1.0.0

1 release file

0.0.22

1 release file

0.0.21

1 release file

0.0.20

1 release file

0.0.19

1 release file

0.0.18

1 release file

0.0.17

1 release file

0.0.15

1 release file

0.0.14

1 release file

0.0.13

1 release file

0.0.12

1 release file

0.0.11

1 release file

0.0.10

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

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