API
Flam is not just a commandline tool, it’s also a python API for using from your scripts:
import flam
# Most interfacing with flam happens through a FlamContext. Create one then start using it.
ctx = flam.FlamContext()
# Configure a list 'watched' based on your IMDb list of movies you've watched.
with ctx.configure() as cfg:
simple_list = flam.SimpleList(
uid = "what you set here doesn't matter, it will be overwritten anyway",
name = 'watched',
concrete_listdef = ctx.parse_listdef('imdb-listid=083886771'),
is_default_fetch = False,
is_default_find = False,
)
cfg.simple_lists_raw.append(simple_list)
# Download the list and store it persistently. Next time you won't have to fetch it again.
ctx.fetch(['watched'])
# Print the titles of watched movies from the year 1999.
watched_movies = ctx.get_movie_list('watched')
filter = ctx.compile_movies_filter(['-release-year', '1999'])
for movie in watched_movies.find_movies(filter):
print(movie['title'])
Contents:
- flam
DEFAULT_FLAM_DIRPrecachePreferenceFlamContextFlamContext.__init__()FlamContext.flam_dirFlamContext.cfg_readonlyFlamContext.fetchersFlamContext.predicatesFlamContext.attributesFlamContext.parse_listdef()FlamContext.register()FlamContext.get_movie_list()FlamContext.configure()FlamContext.fetch()FlamContext.precache()FlamContext.compile_filter()FlamContext.compile_movies_filter()FlamContext.compile_people_filter()FlamContext.compile_roles_filter()
RegistriesOfGroupModeCrewTypeCrewType.DIRECTORCrewType.ASSISTANT_DIRECTORCrewType.PRODUCERCrewType.EXECUTIVE_PRODUCERCrewType.COMPOSERCrewType.CINEMATOGRAPHERCrewType.CHOREOGRAPHERCrewType.EDITORCrewType.WRITERCrewType.CASTCrewType.STUNTCASTCrewType.CASTING_DIRECTORCrewType.ART_DIRECTORCrewType.ADDITIONALCrewType.ANYCrewType.default_group_modeCrewType.iterate_except_any()
parse_ct_gm()ct_gm_to_str()FindableTypeFindableMoviePeopleUidPartsPeoplePeople.type_People.uidPeople.crew_typePeople.group_modePeople.underlying_file_people_readonlyPeople.associated_movies()People.associated_roles()People.minimal_superset_people_in_other_crew_type()People.minimal_superset_people_in_other_list()People.are_in_movie()People.compose_uid()People.decompose_uid()
RoleUidPartsMLFRolesDictRoleMovieListAttributePrimitiveAttributeValueComparisonOpCmpToAttributeAttribute.NONE_STRAttribute.__init__()Attribute.name_without_typeAttribute.aliases_without_typeAttribute.findable_typeAttribute.qualified_nameAttribute.qualified_aliasesAttribute.is_ascendingAttribute.default_opAttribute._parse_primitive_not_none()Attribute._str_of_primitive_not_none()Attribute.sort_key()Attribute.parse_primitive()Attribute.str_of_value()
CanonListdefSpecialListTyperegister()compose_qualified_attr_or_pred_name()decompose_qualified_attr_or_pred_name()FetcherEatParamsFilterMemberFilterMember.excrete()FilterMember.regurgitate()FilterMember.colonoscopy()FilterMember.eat_str()FilterMember.eat_listof()FilterMember.eat_one_of()FilterMember.eat_attribute()FilterMember.eat_cmpto()FilterMember.eat_type()FilterMember.eat_movie_list()FilterMember.eat_ct_gm()FilterMember.eat_subfilter()
FilterPipelineNegativeConjoinedDisjoinedPredicatelooks_like_filter_token()SimpleListCompositeListConfigurationConfigurationListsMLFRoleMLFCrewMLFPersonMLFMoviePerSourceDataMLFMovieMLFMovie.uidMLFMovie.per_src_dataMLFMovie.media_typeMLFMovie.titleMLFMovie.original_titleMLFMovie.taglineMLFMovie.synopsisMLFMovie.urlMLFMovie.runtime_minutesMLFMovie.metascore_votesMLFMovie.metascoreMLFMovie.votesMLFMovie.ratingMLFMovie.my_ratingMLFMovie.likesMLFMovie.is_likedMLFMovie.budget_usdMLFMovie.revenue_usdMLFMovie.content_ratingMLFMovie.release_dateMLFMovie.watch_datesMLFMovie.my_notesMLFMovie.episodes_numMLFMovie.seasons_numMLFMovie.end_dateMLFMovie.genresMLFMovie.studiosMLFMovie.languagesMLFMovie.countriesMLFMovie.crew
MovieListFileFlamEnvis_debug()get_log_file_path()loggerFlamErrorInputErrorCloseInputErrorFilterSyntaxErrorFetchInterruptFileValidationError
- flam.utils
- flam.attrutils
EasyAttributeParamsEasyAttributeMovieExtractorPeopleExtractorRoleExtractorExtractoreasy_attribute()TypeHandlerIntHandlerFloatHandlerBoolHandlerStrHandlerMinutesHandlerDateHandlerSMALL_INT_HANDLERBIG_INT_HANDLERFLOAT_HANDLERBOOL_HANDLERSTR_HANDLERMINUTES_HANDLERDATE_HANDLERSArrayLengthAttributeStringLengthAttributeAverageAttributeSumAttribute