-
Notifications
You must be signed in to change notification settings - Fork 0
Home
David Vegh edited this page Aug 15, 2022
·
4 revisions
write-condastat makes it easy to collect, filter and save conda statistics to csv files.
Visit our documentation site for code reference.
In these examples we initilaize a WriteCondaStat
class in order to collect statistics about pandas
conda package.
Parameters:
-
package_name
: name of the target conda package -
outdir
: path of the directory where the gathered data will be saved into csv files
Because outdir
is None
the gathered statistics will be only printed to the console.
from writecondastat import WriteCondaStat
write_condastat = WriteCondaStat("pandas")
Because outdir
is not None
the gathered statistics will be saved into csv files too.
from writecondastat import WriteCondaStat
write_condastat = WriteCondaStat("pandas", "stats/pandas")
Properties:
-
outdir
: path of the directory where the gathered data will be saved into csv files -
date_period
: grouping of the statistics -
write_package_name
: flag used to write the name of the package into a csv column -
merge_stored_data
: flag used to merge actual conda statistics with previously stored -
fill_no_data
: flag used to create empty lines with 0 download when data is not available
outdir
can be changed or set at anytime.
from writecondastat import WriteCondaStat
write_condastat = WriteCondaStat("pandas")
write_condastat.outdir = "stats/pandas"
from writecondastat import WriteCondaStat
write_condastat = WriteCondaStat("pandas")
write_condastat.date_period= "month"
from writecondastat import WriteCondaStat
write_condastat = WriteCondaStat("pandas")
write_condastat.write_package_name = True
from writecondastat import WriteCondaStat
write_condastat = WriteCondaStat("pandas")
write_condastat.merge_stored_data = False
from writecondastat import WriteCondaStat
write_condastat = WriteCondaStat("pandas")
write_condastat.fill_no_data = False
Parameters:
-
*data_source
: type of the data source, for example conda-forge -
start_date
: start date of the statistics -
end_date
: end date of the statistics
from writecondastat import WriteCondaStat, CondaStatDataSource
write_condastat = WriteCondaStat("pandas", "stats/pandas")
stats = write_condastat.get_condastat(
CondaStatDataSource.CONDAFORGE,
start_date="2022-03",
end_date="2022-04-10"
)
Parameters:
-
*data_source
: type of the data source, for example conda-forge -
start_date
: start date of the statistics -
end_date
: end date of the statistics -
postfix
: postfix of the csv file
Example - Write anaconda and conda-forge statistics between 2022-01-01
and 2022-03-31
, grouped by month
from writecondastat import WriteCondaStat, CondaStatDataSource
write_condastat = WriteCondaStat("pandas", "stats/pandas")
write_condastat.date_period = "month"
write_condastat.write_condastat(
CondaStatDataSource.CONDAFORGE,
CondaStatDataSource.ANACONDA,
start_date="2022",
end_date="2022-03"
)
Parameters:
-
*data_source
: type of the data source, for example conda-forge -
postfix
: postfix of the csv file
from writecondastat import WriteCondaStat, CondaStatDataSource
write_condastat = WriteCondaStat("pandas", "stats/pandas")
write_condastat.write_actual_condastat(
CondaStatDataSource.CONDAFORGE,
CondaStatDataSource.ANACONDA,
)