dbmanager.py¶
This module contains operations to manipulate the database
Warning: since it involves manipulating source code, some operations may not be very reliable.
Additionaly, we currently do not have tests for this file.
Thus, my suggestion is to use only the insert() and set_attribute() functions.
These functions were heavily used during my snowballing.
For other operations, such as removing citations/work, I recommend editting files manually.
Relevant functions¶
insert¶
-
insert(text, citations=None, ratio=0.9, dry_run=False)[source]¶ Insert text that might contain works and citations.
Arguments:
- text – code with work and citations
Keyword arguments:
- citations – citations filename
- ratio – comparison threshold for existing work
- dry_run – do not apply changes to the database
Example:
insert(''' pimentel2016a = DB(WorkSnowball( 2016, "Tracking and analyzing the evolution of provenance from scripts", display="noworkflow a", authors="Pimentel, João Felipe and Freire, Juliana and Braganholo, Vanessa and Murta, Leonardo", place=IPAW, pp="16--28", entrytype="inproceedings", )) DB(Citation( pimentel2016a, murta2014a, ref="[14]", contexts=[ ], )) ''', citations="murta2014a");
set_attribute¶
-
set_attribute(varname, field, value, year=None, dry_run=False, old=None)[source]¶ Set attribute for work
Arguments:
- varname – work variable name
- field – work attribute name
- value – new value for attribute
Keyword arguments:
- year – limit work search for specific year
- dry_run – do not apply changes to the database
Example:
set_attribute('murta2014a', "display", "now");