معرفی شرکت ها


dspreview-0.1.9


Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر

توضیحات

a simple preview for dsp digital advertising information
ویژگی مقدار
سیستم عامل -
نام فایل dspreview-0.1.9
نام dspreview
نسخه کتابخانه 0.1.9
نگهدارنده []
ایمیل نگهدارنده []
نویسنده Thiago Melo
ایمیل نویسنده thiago.lc.melo@gmail.com
آدرس صفحه اصلی https://github.com/thiagolcmelo/dspreview
آدرس اینترنتی https://pypi.org/project/dspreview/
مجوز -
dspreview ========= Tool for merging DSP data from many providers in a single view. There are CLI tools for launching the workers responsible for parsing ``.csv`` files and storing them in a MySQL database. There is also a web app where it is possible to have a complete report of the operation. Configuration ------------- You must specify the following environment variables prior to usage: - ``DB_HOST`` the url or ip for the mysql server - ``DB_PORT`` the port for the mysql server - ``DB_NAME`` the name of the database - ``DB_USER`` a user with writing permission - ``DB_PASS`` the user's password If you inted to develop or change something, it is also need: - ``DB_TEST_NAME`` the name of the database (for testing purposes) - ``DB_TEST_USER`` a user with writing permission (for testing purposes) - ``DB_TEST_PASS`` the user's password (for testing purposes) Since this project has support only for GCP (currently), the following environment variables are also mandatory: - ``GOOGLE_APPLICATION_CREDENTIALS`` the json file for an account with admin permissions for the `Storage`_ service. - ``GCP_BUCKET`` the bucket where the ``.csv`` file will be placed It is possible to set the workers to consume a RabbitMQ queue, so it is necessary to specify the server info: - ``MQ_HOST`` the RabbitMQ server ip address - ``MQ_PORT`` the RabbitMQ port - ``MQ_VHOST`` the RabbitMQ virtual host - ``MQ_USER`` the RabbitMQ user - ``MQ_PASS`` the RabbitMQ password - ``MQ_QUEUE`` the RabbitMQ queue name (we might change for workers operating through exchanges later, so we can have multiple workers operating at the same time, but for now lets use one queue). A much better option would be to set all these variables in a file named ``.dspreview.csg`` in the users home folder: :: { "GOOGLE_APPLICATION_CREDENTIALS": "/home/user/service_account.json", "GCP_BUCKET": "...", "DB_HOST": "...", "DB_PORT": "3306", "DB_NAME": "...", "DB_USER": "...", "DB_PASS": "..." } If the above environment variables are set, you can initialize the system. It will create the database, tables, and so on. It might be donne through: :: $ dspreview init There are currently two workers: ``dcm`` and ``dsp``. The ``dcm`` worker expects to find a file named ``dcm.csv`` inside the ``GCP_BUCKET``, with the following structure: **[date, campaign_id, campaign, placement_id, placement, impressions, clicks, reach]** where: - ``date`` should be in format YYYY-MM-DD - ``campaign_id`` is an integer - ``campaign`` is a string with the information ``brand_subbrand`` - ``placement_id`` is an integer - ``placement`` is a string with the information ``dsp_adtype`` - ``impressions`` is an integer - ``clicks`` is an integer - ``reach`` is an float, please take care to not repeat this, since it is a calculated metric While the ``dsp`` worker expect to find a file with the dsp's name (like ``dbm.csv`` or ``mediamath.csv``) and the following structure: **[date, campaign_id, campaign, impressions, clicks, cost]** where: - ``date`` should be in format YYYY-MM-DD - ``campaign_id`` is an integer - ``campaign`` is a string with the information ``brand_subbrand_adtype`` - ``impressions`` is an integer - ``clicks`` is an integer - ``cost`` is a float In order to launch a worker, you might use the command: :: $ dspreview --worker dcm or: :: $ dspreview --worker dsp If the DSP is known in advance, you might run: :: $ dspreview --worker dsp --dsp dbm or :: $ dspreview --worker dsp --dsp mediamath When all files are stored in the MySQL database, the following command generates the full report: :: $ dspreview --generate-report The web app might be run through: :: $ dspreview serve --port 80 The default port is ``80`` Finally, it is possible to put the worker to run in a loop, in this case, it will consume a queue in the RabbitMQ. The messages must be: - ``dcm`` for the DCM worker - ``dsp`` for running all DSP workers - ``dsp.dbm`` for running a specific DSP worker (DBM in this case) - ``report`` for generating full report The worker might be launched as: :: $ dspreview operate It is possible to add itens to the queue through: :: $ dspreview --poke "dsp.dbm" Classifications --------------- Besides the configuration described above, it is also important to understand the ``classifications``. The classifications might be managed through the webserver in the underlying section. The idea is that each line in the DCM and DSP files might be classified according to a **brand**, a **sub brand**, and a **dsp**. You can create a regex that will be checked against a combination of fields. For instance, it is a line in the DBM file: +------------+-------------+---------------------+-------------+--------+------------+ | date | campaign_id | campaign | impressions | clicks | cost | +============+=============+=====================+=============+========+============+ | 2018-01-01 | 128115 | acme_asprin_youtube | 6011070 | 11889 | 40334.2797 | +------------+-------------+---------------------+-------------+--------+------------+ You might choose to apply the regex ``.*acme.*`` for classifying the brand as **Acme**, and the only necessary field is ``campaign``. Chances are that you have another brand, say **Umbrella Corp**, and for some reason, you end up with a line like: +------------+-------------+---------------------+-------------+--------+------------+ | date | campaign_id | campaign | impressions | clicks | cost | +============+=============+=====================+=============+========+============+ | 2018-03-01 | 475987 | acme_solution | 4867867 | 46454 | 87897.4558 | +------------+-------------+---------------------+-------------+--------+------------+ Now, the regex above would classify both this lines as **Acme**. A solution would be change the regex to ``^128115acme.*`` applied to the concatenation of fields ``campaign_id`` and ``campaign``, in order to identify ads belonging to the brand **Acme**. For identifying ads belonging to **Umbrella Corp** the regex could be ``^475987acme.*`` applied to the concatenation of fields ``campaign_id`` and ``campaign``. The fields that can be used are: 1. campaign_id 2. campaign 3. placement_id (form DCM files only) 4. placement (form DCM files only) Fields will be concatenated in this order. The regex patterns will be applied in the order in which they are registered in the database. The first matching a combination of fields will define the classification, so it is necessary to avoid ubiquitous regex. Preparing for Development ------------------------- 1. Ensure ``pip`` and ``pipenv`` are installed. 2. Make sure you also have ``default-libmysqlclient-dev`` or ``libmysqlclient-dev`` installed. 3. Clone repository: ``https://github.com/thiagolcmelo/dspreview`` 4. Fetch development dependencies: ``make install`` Running Tests ------------- Run tests locally using ``make`` if virtualenv is active: :: $ make If virtualenv isn't active then use :: $ pipenv run make .. _Storage: https://cloud.google.com/storage/ .. _SQL: https://cloud.google.com/sql/


نیازمندی

مقدار نام
==1.0.0 alembic
==2.1.0 cachetools
==2018.8.24 certifi
==3.0.4 chardet
==6.7 click
==2.3.1 dominate
==3.3.7.1 flask-bootstrap
==0.4.1 flask-login
==2.2.1 flask-migrate
==2.3.2 flask-sqlalchemy
==0.7.1 flask-testing
==0.14.2 flask-wtf
==1.0.2 flask
==1.6.6 google-api-python-client
==0.0.3 google-auth-httplib2
==1.4.1 google-auth
==0.11.3 httplib2
==2.7 idna
==0.24 itsdangerous
==2.10 jinja2
==1.0.7 mako
==1.0 markupsafe
==1.3.13 mysqlclient
==4.1.2 oauth2client
==0.23.4 pandas
==0.12.0 pika
==1.4.2 pkginfo
==2.7.5 psycopg2
==0.2.2 pyasn1-modules
==0.4.4 pyasn1
==2.7.3 python-dateutil
==1.0.3 python-editor
==2018.5 pytz
==2.19.1 requests
==3.4.2 rsa
==1.11.0 six
==1.2.11 sqlalchemy
==1.11.0 twine
==3.0.0 uritemplate
==0.1.3 visitor
==0.14.1 werkzeug
==2.2.1 wtforms
==1.23) urllib3
==1.15.1) numpy
==0.8.0) requests-toolbelt
==4.25.0) tqdm


نحوه نصب


نصب پکیج whl dspreview-0.1.9:

    pip install dspreview-0.1.9.whl


نصب پکیج tar.gz dspreview-0.1.9:

    pip install dspreview-0.1.9.tar.gz